aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/sign_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:31:31 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-01-25 18:31:31 +0000
commit9243becbedbb6a1592208051f8fa2b090dcc5e7d (patch)
tree607c2a862ec3f4399b8766383f6f8e04c4aa43b4 /test/functional/ui/sign_spec.lua
parent9e40b6e9e1bc67f2d856adb837ee64dd0e25b717 (diff)
parent3c48d3c83fc21dbc0841f9210f04bdb073d73cd1 (diff)
downloadrneovim-usermarks.tar.gz
rneovim-usermarks.tar.bz2
rneovim-usermarks.zip
Merge remote-tracking branch 'upstream/master' into usermarksusermarks
Diffstat (limited to 'test/functional/ui/sign_spec.lua')
-rw-r--r--test/functional/ui/sign_spec.lua97
1 files changed, 95 insertions, 2 deletions
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index dbc92ca222..7dcd4cff25 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, command = helpers.clear, helpers.feed, helpers.command
local source = helpers.source
+local meths = helpers.meths
describe('Signs', function()
local screen
@@ -155,9 +156,12 @@ describe('Signs', function()
{0:~ }|
|
]])
+ -- Check that 'statuscolumn' correctly applies numhl
+ command('set statuscolumn=%s%=%l\\ ')
+ screen:expect_unchanged()
end)
- it('higlights the cursorline sign with culhl', function()
+ it('highlights the cursorline sign with culhl', function()
feed('ia<cr>b<cr>c<esc>')
command('sign define piet text=>> texthl=Search culhl=ErrorMsg')
command('sign place 1 line=1 name=piet buffer=1')
@@ -232,11 +236,13 @@ describe('Signs', function()
|
]])
command('set cursorlineopt=number')
+ command('hi! link SignColumn IncSearch')
+ feed('Go<esc>2G')
screen:expect([[
{1:>>}a |
{8:>>}^b |
{1:>>}c |
- {0:~ }|
+ {5: } |
{0:~ }|
{0:~ }|
{0:~ }|
@@ -248,6 +254,9 @@ describe('Signs', function()
{0:~ }|
|
]])
+ -- Check that 'statuscolumn' cursorline/signcolumn highlights are the same (#21726)
+ command('set statuscolumn=%s')
+ screen:expect_unchanged()
end)
it('multiple signs #9295', function()
@@ -592,4 +601,88 @@ describe('Signs', function()
]])
end)
end)
+
+ it('signcolumn width is updated when removing all signs after deleting lines', function()
+ meths.buf_set_lines(0, 0, 1, true, {'a', 'b', 'c', 'd', 'e'})
+ command('sign define piet text=>>')
+ command('sign place 10001 line=1 name=piet')
+ command('sign place 10002 line=5 name=piet')
+ command('2delete')
+ command('sign unplace 10001')
+ screen:expect([[
+ {2: }a |
+ {2: }^c |
+ {2: }d |
+ >>e |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ command('sign unplace 10002')
+ screen:expect([[
+ a |
+ ^c |
+ d |
+ e |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end)
+
+ it('signcolumn width is updated when removing all signs after inserting lines', function()
+ meths.buf_set_lines(0, 0, 1, true, {'a', 'b', 'c', 'd', 'e'})
+ command('sign define piet text=>>')
+ command('sign place 10001 line=1 name=piet')
+ command('sign place 10002 line=5 name=piet')
+ command('copy .')
+ command('sign unplace 10001')
+ screen:expect([[
+ {2: }a |
+ {2: }^a |
+ {2: }b |
+ {2: }c |
+ {2: }d |
+ >>e |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ command('sign unplace 10002')
+ screen:expect([[
+ a |
+ ^a |
+ b |
+ c |
+ d |
+ e |
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ {0:~ }|
+ |
+ ]])
+ end)
end)