* color.c (init_colors) [HAVE_SLANG]: Use SLtt_set_color() to

associate the default colors with DEFAULT_COLOR_INDEX. The old
code would unset alternative charset without making S-Lang aware
of it.
Thanks to John E. Davis <davis@space.mit.edu>
* widget.c (update_input) [HAVE_SLANG]: Revert last change - it
is not needed now.
This commit is contained in:
Pavel Roskin 2001-05-28 19:38:47 +00:00
parent 6eda540762
commit c2d9b832e9
3 changed files with 16 additions and 24 deletions

View File

@ -1,3 +1,13 @@
2001-05-28 Pavel Roskin <proski@gnu.org>
* color.c (init_colors) [HAVE_SLANG]: Use SLtt_set_color() to
associate the default colors with DEFAULT_COLOR_INDEX. The old
code would unset alternative charset without making S-Lang aware
of it.
Thanks to John E. Davis <davis@space.mit.edu>
* widget.c (update_input) [HAVE_SLANG]: Revert last change - it
is not needed now.
2001-05-28 Andrew V. Samoilov <sav@bcs.zp.ua>
* main.c: Correct some comments after #endif

View File

@ -294,15 +294,12 @@ void init_colors (void)
#endif
#if defined HAVE_SLANG && !defined(HAS_DIRECT_COLOR_ACCESS)
if (use_colors) { /* Hack to make COLOR_PAIR(DEFAULT_COLOR_INDEX)
be the default fg/bg of the terminal */
char *Norm_Vid = SLtt_tgetstr ("me");
if (Norm_Vid == NULL)
Norm_Vid = SLtt_tgetstr ("se");
if (Norm_Vid == NULL)
Norm_Vid = "\033[0m";
SLtt_set_color_esc (DEFAULT_COLOR_INDEX, Norm_Vid);
if (use_colors) { /* We are relying on undocumented feature of
S-Lang to make COLOR_PAIR(DEFAULT_COLOR_INDEX)
the default fg/bg of the terminal.
Hopefully, future versions of S-Lang will
document this feature. */
SLtt_set_color (DEFAULT_COLOR_INDEX, NULL, NULL, NULL);
}
#endif

View File

@ -840,24 +840,9 @@ update_input (WInput *in, int clear_first)
attrset (in->color);
#ifdef HAVE_SLANG
/*
* acs() and noacs() here are a workaround for what seems to be
* a bug in SLang 1.x (up to 1.4.4, but not in 0.99.38). Without
* them, the first dialog box to appear may have part of its
* frame displayed in ASCII characters instead of line drawing
* characters. Subshell support and color terminal are needed for
* the bug to show up.
*/
acs ();
SLsmg_fill_region (in->widget.y, in->widget.x,
1, in->field_len - has_history, ' ');
noacs ();
#else
widget_move (&in->widget, 0, 0);
for (i = 0; i < in->field_len - has_history; i++)
addch (' ');
#endif
widget_move (&in->widget, 0, 0);
for (i = 0, j = in->first_shown; i < in->field_len - has_history && in->buffer [j]; i++){