aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-06-11 09:52:10 +0200
committerGitHub <noreply@github.com>2024-06-11 09:52:10 +0200
commitd8e384b7bfd5829e5ff5006202faa584b3211e84 (patch)
tree59d4795269ae72e6242fec037d6aadb220a90389 /test/functional
parent37bf4c572a8fa20dc4a8433524ecc8c8d68fe53c (diff)
parent1dcda865591b9bdda2fec1a1860efb4df56ea533 (diff)
downloadrneovim-d8e384b7bfd5829e5ff5006202faa584b3211e84.tar.gz
rneovim-d8e384b7bfd5829e5ff5006202faa584b3211e84.tar.bz2
rneovim-d8e384b7bfd5829e5ff5006202faa584b3211e84.zip
Merge pull request #29272 from luukvbaal/signcol
fix(column): clamp line number for legacy signs
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/ui/sign_spec.lua30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua
index b353b3738a..6f4bf5695d 100644
--- a/test/functional/ui/sign_spec.lua
+++ b/test/functional/ui/sign_spec.lua
@@ -577,4 +577,34 @@ describe('Signs', function()
]])
eq({}, eval('sign_getdefined()'))
end)
+
+ it('no crash when unplacing signs beyond end of buffer', function()
+ exec([[
+ sign define S1 text=S1
+ sign define S2 text=S2
+ sign place 1 line=8 name=S1
+ sign place 2 line=9 name=S2
+ ]])
+ -- Now placed at end of buffer
+ local s1 = {
+ grid = [[
+ S2^ |
+ {0:~ }|*12
+ |
+ ]],
+ }
+ screen:expect(s1)
+ -- Signcolumn tracking used to not count signs placed beyond end of buffer here
+ exec('set signcolumn=auto:9')
+ screen:expect({
+ grid = [[
+ S2S1^ |
+ {0:~ }|*12
+ |
+ ]],
+ })
+ -- Unplacing the sign does not crash by decrementing tracked signs below zero
+ exec('sign unplace 1')
+ screen:expect(s1)
+ end)
end)