diff options
-rw-r--r-- | src/nvim/drawscreen.c | 4 | ||||
-rw-r--r-- | test/functional/ui/sign_spec.lua | 32 |
2 files changed, 33 insertions, 3 deletions
diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index 94eeb9bc77..9a5cfc7d07 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -954,7 +954,6 @@ int showmode(void) lines_left = 0; if (do_mode) { - int sub_attr; msg_puts_attr("--", attr); // CTRL-X in Insert mode if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU)) { @@ -981,7 +980,8 @@ int showmode(void) } if (edit_submode_extra != NULL) { msg_puts_attr(" ", attr); // Add a space in between. - if ((int)edit_submode_highl < HLF_COUNT) { + int sub_attr; + if (edit_submode_highl < HLF_COUNT) { sub_attr = win_hl_attr(curwin, (int)edit_submode_highl); } else { sub_attr = attr; diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index 316d3fe3ac..d47c4ae230 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -368,13 +368,14 @@ describe('Signs', function() ]]) end) - it('shows the line number when signcolumn=number but no marks on a line have text', function() + it('signcolumn=number', function() feed('ia<cr>b<cr>c<cr><esc>') command('set number signcolumn=number') command('sign define pietSearch text=>> texthl=Search numhl=Error') command('sign define pietError text= texthl=Search numhl=Error') command('sign place 1 line=1 name=pietSearch buffer=1') command('sign place 2 line=2 name=pietError buffer=1') + -- line number should be drawn if sign has no text -- no signcolumn, line number for "a" is Search, for "b" is Error, for "c" is LineNr screen:expect([[ {1: >> }a | @@ -384,6 +385,35 @@ describe('Signs', function() {0:~ }|*9 | ]]) + -- number column on wrapped part of a line should be empty + feed('gg100aa<Esc>') + screen:expect([[ + {1: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aa^a | + {8: 2 }b | + {6: 3 }c | + {6: 4 } | + {0:~ }|*7 + | + ]]) + meths.buf_set_extmark(0, meths.create_namespace('test'), 0, 0, { + virt_lines = { { { 'VIRT LINES' } } }, + virt_lines_above = true, + }) + feed('<C-Y>') + -- number column on virtual lines should be empty + screen:expect([[ + VIRT LINES | + {1: >> }aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aa^a | + {8: 2 }b | + {6: 3 }c | + {6: 4 } | + {0:~ }|*6 + | + ]]) end) it('can have 32bit sign IDs', function() |