main: Fix color schemes for abstract_ui

- Set 't_Co' to 256 at startup. The value can be changed by the user for
  compatibility with terminals that are less capable.
- `has('gui_running')` will return 1 if at least one rgb UI is attached.

Even though these changes are hacky, they are necessary to make the transition
to the new UI architecture smoother.
This commit is contained in:
Thiago de Arruda
2015-01-13 08:38:38 -03:00
parent 8f3e61a043
commit 3e9c55b51b
5 changed files with 24 additions and 13 deletions

View File

@@ -6150,8 +6150,7 @@ void screen_fill(int start_row, int end_row, int start_col, int end_col, int c1,
return;
/* it's a "normal" terminal when not in a GUI or cterm */
norm_term = (
t_colors <= 1);
norm_term = (!abstract_ui && t_colors <= 1);
for (row = start_row; row < end_row; ++row) {
if (has_mbyte
) {
@@ -6675,8 +6674,8 @@ static void linecopy(int to, int from, win_T *wp)
*/
int can_clear(char_u *p)
{
return *p != NUL && (t_colors <= 1
|| cterm_normal_bg_color == 0 || *T_UT != NUL);
return abstract_ui || (*p != NUL && (t_colors <= 1
|| cterm_normal_bg_color == 0 || *T_UT != NUL));
}
/*