aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-07-06 14:39:50 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2018-07-21 13:21:58 +0200
commit1adb01c120d04bdbf25cd4ea6151ecd5f2de3a72 (patch)
tree1f906f5f77b77bc0beecb33320ceb4c15ff5c58e /src/nvim/syntax.c
parent2134396074d86c344aaf43c3b839fd38c499fb69 (diff)
downloadrneovim-1adb01c120d04bdbf25cd4ea6151ecd5f2de3a72.tar.gz
rneovim-1adb01c120d04bdbf25cd4ea6151ecd5f2de3a72.tar.bz2
rneovim-1adb01c120d04bdbf25cd4ea6151ecd5f2de3a72.zip
ui: use line-based rather than char-based updates in screen.c
Add ext_newgrid and ext_hlstate extensions. These use predefined highlights and line-segment based updates, for efficiency and simplicity.. The ext_hlstate extension in addition allows semantic identification of builtin and syntax highlights. Reimplement the old char-based updates in the remote UI layer, for compatibility. For the moment, this is still the default. The bulitin TUI uses the new line-based protocol. cmdline uses curwin cursor position when ext_cmdline is active.
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index ff9619574b..ff47e443f9 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -6798,14 +6798,12 @@ void do_highlight(const char *line, const bool forceit, const bool init)
HL_TABLE()[idx].sg_cterm_fg = color + 1;
if (is_normal_group) {
cterm_normal_fg_color = color + 1;
- must_redraw = CLEAR;
}
} else {
HL_TABLE()[idx].sg_cterm_bg = color + 1;
if (is_normal_group) {
cterm_normal_bg_color = color + 1;
if (!ui_rgb_attached()) {
- must_redraw = CLEAR;
if (color >= 0) {
int dark = -1;
@@ -6909,8 +6907,16 @@ void do_highlight(const char *line, const bool forceit, const bool init)
// Need to update all groups, because they might be using "bg" and/or
// "fg", which have been changed now.
highlight_attr_set_all();
- // If the normal group has changed, it is simpler to refresh every UI
- ui_refresh();
+
+ if (!ui_is_external(kUINewgrid)) {
+ // Older UIs assume that we clear the screen after normal group is
+ // changed
+ ui_refresh();
+ } else {
+ // TUI and newer UIs will repaint the screen themselves. NOT_VALID
+ // redraw below will still handle usages of guibg=fg etc.
+ ui_default_colors_set();
+ }
} else {
set_hl_attr(idx);
}