diff --git a/lua/themes/dark-16.lua b/lua/themes/dark-16.lua index 534b2d8f6..7e8987dd6 100644 --- a/lua/themes/dark-16.lua +++ b/lua/themes/dark-16.lua @@ -28,7 +28,7 @@ lexers.STYLE_IDENTIFIER = 'fore:white' lexers.STYLE_LINENUMBER = 'fore:white' lexers.STYLE_LINENUMBER_CURSOR = lexers.STYLE_LINENUMBER lexers.STYLE_CURSOR = 'reverse' -lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:yellow' +lexers.STYLE_CURSOR_MATCHING = lexers.STYLE_CURSOR..',fore:yellow' lexers.STYLE_CURSOR_LINE = 'underlined' lexers.STYLE_COLOR_COLUMN = 'back:red' lexers.STYLE_SELECTION = 'back:white' diff --git a/lua/themes/light-16.lua b/lua/themes/light-16.lua index 1f4bd7832..8ad95ca28 100644 --- a/lua/themes/light-16.lua +++ b/lua/themes/light-16.lua @@ -28,7 +28,7 @@ lexers.STYLE_IDENTIFIER = 'fore:black' lexers.STYLE_LINENUMBER = 'fore:black' lexers.STYLE_LINENUMBER_CURSOR = lexers.STYLE_LINENUMBER lexers.STYLE_CURSOR = 'reverse' -lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',fore:yellow' +lexers.STYLE_CURSOR_MATCHING = lexers.STYLE_CURSOR..',fore:yellow' lexers.STYLE_CURSOR_LINE = 'underlined' lexers.STYLE_COLOR_COLUMN = 'back:red' lexers.STYLE_SELECTION = 'back:black' diff --git a/lua/themes/solarized.lua b/lua/themes/solarized.lua index 7f408586a..426b86fcf 100644 --- a/lua/themes/solarized.lua +++ b/lua/themes/solarized.lua @@ -57,7 +57,7 @@ lexers.STYLE_IDENTIFIER = fg lexers.STYLE_LINENUMBER = 'fore:'..colors.base00..',back:'..colors.base02 lexers.STYLE_LINENUMBER_CURSOR = 'back:'..colors.base00..',fore:'..colors.base02 lexers.STYLE_CURSOR = 'fore:'..colors.base03..',back:'..colors.base0 -lexers.STYLE_CURSOR_PRIMARY = lexers.STYLE_CURSOR..',back:yellow' +lexers.STYLE_CURSOR_MATCHING = lexers.STYLE_CURSOR..',back:yellow' lexers.STYLE_CURSOR_LINE = 'back:'..colors.base02 lexers.STYLE_COLOR_COLUMN = 'back:'..colors.base02 -- lexers.STYLE_SELECTION = 'back:'..colors.base02 diff --git a/lua/themes/zenburn.lua b/lua/themes/zenburn.lua index 1cefb10b1..b73a2b96b 100644 --- a/lua/themes/zenburn.lua +++ b/lua/themes/zenburn.lua @@ -28,7 +28,7 @@ lexers.STYLE_IDENTIFIER = '' lexers.STYLE_LINENUMBER = 'fore:#585858' lexers.STYLE_LINENUMBER_CURSOR = 'fore:#666666' lexers.STYLE_CURSOR = 'back:#585858' -lexers.STYLE_CURSOR_PRIMARY = 'fore:#1c1c1c,back:#87afaf,bold' +lexers.STYLE_CURSOR_MATCHING = 'fore:#1c1c1c,back:#87afaf,bold' lexers.STYLE_CURSOR_LINE = 'back:#444444' lexers.STYLE_COLOR_COLUMN = 'back:#444444' lexers.STYLE_SELECTION = 'back:#5f875f' diff --git a/lua/vis.lua b/lua/vis.lua index 2432c7200..3f493258f 100644 --- a/lua/vis.lua +++ b/lua/vis.lua @@ -258,7 +258,7 @@ vis.types.window.set_syntax = function(win, syntax) win:style_define(win.STYLE_DEFAULT, lexers.STYLE_DEFAULT or '') win:style_define(win.STYLE_CURSOR, lexers.STYLE_CURSOR or '') - win:style_define(win.STYLE_CURSOR_PRIMARY, lexers.STYLE_CURSOR_PRIMARY or '') + win:style_define(win.STYLE_CURSOR_MATCHING, lexers.STYLE_CURSOR_MATCHING or '') win:style_define(win.STYLE_CURSOR_LINE, lexers.STYLE_CURSOR_LINE or '') win:style_define(win.STYLE_SELECTION, lexers.STYLE_SELECTION or '') win:style_define(win.STYLE_LINENUMBER, lexers.STYLE_LINENUMBER or '') diff --git a/ui-terminal.c b/ui-terminal.c index 59ed1fc8e..579cdac94 100644 --- a/ui-terminal.c +++ b/ui-terminal.c @@ -559,7 +559,7 @@ static UiWin *ui_window_new(Ui *ui, Win *w, enum UiOption options) { } styles[UI_STYLE_CURSOR].attr |= CELL_ATTR_REVERSE; - styles[UI_STYLE_CURSOR_PRIMARY].attr |= CELL_ATTR_REVERSE|CELL_ATTR_BLINK; + styles[UI_STYLE_CURSOR_MATCHING].attr |= CELL_ATTR_REVERSE; styles[UI_STYLE_SELECTION].attr |= CELL_ATTR_REVERSE; styles[UI_STYLE_COLOR_COLUMN].attr |= CELL_ATTR_REVERSE; styles[UI_STYLE_STATUS].attr |= CELL_ATTR_REVERSE; diff --git a/ui.h b/ui.h index ce98af1c1..7f4617a09 100644 --- a/ui.h +++ b/ui.h @@ -37,7 +37,7 @@ enum UiStyle { UI_STYLE_LEXER_MAX = 64, UI_STYLE_DEFAULT, UI_STYLE_CURSOR, - UI_STYLE_CURSOR_PRIMARY, + UI_STYLE_CURSOR_MATCHING, UI_STYLE_CURSOR_LINE, UI_STYLE_SELECTION, UI_STYLE_LINENUMBER, diff --git a/vis-lua.c b/vis-lua.c index 62c0e4c11..8a1e12a0e 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -3266,7 +3266,7 @@ void vis_lua_init(Vis *vis) { } styles[] = { { UI_STYLE_DEFAULT, "STYLE_DEFAULT" }, { UI_STYLE_CURSOR, "STYLE_CURSOR" }, - { UI_STYLE_CURSOR_PRIMARY, "STYLE_CURSOR_PRIMARY" }, + { UI_STYLE_CURSOR_MATCHING, "STYLE_CURSOR_MATCHING" }, { UI_STYLE_CURSOR_LINE, "STYLE_CURSOR_LINE" }, { UI_STYLE_SELECTION, "STYLE_SELECTION" }, { UI_STYLE_LINENUMBER, "STYLE_LINENUMBER" }, diff --git a/vis.c b/vis.c index d3cb9cbc4..028fea3de 100644 --- a/vis.c +++ b/vis.c @@ -423,8 +423,6 @@ static void window_draw_cursor(Win *win, Selection *cur, CellStyle *style, CellS if (!line || col == -1) return; line->cells[col].style = *style; - window_draw_cursor_matching(win, cur, sel_style); - return; } static void window_draw_selections(Win *win) { @@ -432,7 +430,7 @@ static void window_draw_selections(Win *win) { Filerange viewport = view_viewport_get(view); Selection *sel = view_selections_primary_get(view); CellStyle style_cursor = win->ui->style_get(win->ui, UI_STYLE_CURSOR); - CellStyle style_cursor_primary = win->ui->style_get(win->ui, UI_STYLE_CURSOR_PRIMARY); + CellStyle style_cursor_matching = win->ui->style_get(win->ui, UI_STYLE_CURSOR_MATCHING); CellStyle style_selection = win->ui->style_get(win->ui, UI_STYLE_SELECTION); for (Selection *s = view_selections_prev(sel); s; s = view_selections_prev(s)) { window_draw_selection(win->view, s, &style_selection); @@ -440,9 +438,10 @@ static void window_draw_selections(Win *win) { if (pos < viewport.start) break; window_draw_cursor(win, s, &style_cursor, &style_selection); + window_draw_cursor_matching(win, s, &style_cursor_matching); } window_draw_selection(win->view, sel, &style_selection); - window_draw_cursor_matching(win, sel, &style_cursor_primary); + window_draw_cursor_matching(win, sel, &style_cursor_matching); for (Selection *s = view_selections_next(sel); s; s = view_selections_next(s)) { window_draw_selection(win->view, s, &style_selection); size_t pos = view_cursors_pos(s);