mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 11:28:22 +00:00
test: sign on wrapped line with signcolumn=number (#26654)
This commit is contained in:
@@ -954,7 +954,6 @@ int showmode(void)
|
|||||||
lines_left = 0;
|
lines_left = 0;
|
||||||
|
|
||||||
if (do_mode) {
|
if (do_mode) {
|
||||||
int sub_attr;
|
|
||||||
msg_puts_attr("--", attr);
|
msg_puts_attr("--", attr);
|
||||||
// CTRL-X in Insert mode
|
// CTRL-X in Insert mode
|
||||||
if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU)) {
|
if (edit_submode != NULL && !shortmess(SHM_COMPLETIONMENU)) {
|
||||||
@@ -981,7 +980,8 @@ int showmode(void)
|
|||||||
}
|
}
|
||||||
if (edit_submode_extra != NULL) {
|
if (edit_submode_extra != NULL) {
|
||||||
msg_puts_attr(" ", attr); // Add a space in between.
|
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);
|
sub_attr = win_hl_attr(curwin, (int)edit_submode_highl);
|
||||||
} else {
|
} else {
|
||||||
sub_attr = attr;
|
sub_attr = attr;
|
||||||
|
@@ -368,13 +368,14 @@ describe('Signs', function()
|
|||||||
]])
|
]])
|
||||||
end)
|
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>')
|
feed('ia<cr>b<cr>c<cr><esc>')
|
||||||
command('set number signcolumn=number')
|
command('set number signcolumn=number')
|
||||||
command('sign define pietSearch text=>> texthl=Search numhl=Error')
|
command('sign define pietSearch text=>> texthl=Search numhl=Error')
|
||||||
command('sign define pietError 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 1 line=1 name=pietSearch buffer=1')
|
||||||
command('sign place 2 line=2 name=pietError 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
|
-- no signcolumn, line number for "a" is Search, for "b" is Error, for "c" is LineNr
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
{1: >> }a |
|
{1: >> }a |
|
||||||
@@ -384,6 +385,35 @@ describe('Signs', function()
|
|||||||
{0:~ }|*9
|
{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)
|
end)
|
||||||
|
|
||||||
it('can have 32bit sign IDs', function()
|
it('can have 32bit sign IDs', function()
|
||||||
|
Reference in New Issue
Block a user