diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2024-06-10 16:55:16 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2024-06-10 20:00:59 +0200 |
commit | 1dcda865591b9bdda2fec1a1860efb4df56ea533 (patch) | |
tree | 881b423a64bd4d2a9e6f4170c9115a2a1e73d67b /test/old | |
parent | d9af8c2431b7c6395abece8104be6a47d6f61f39 (diff) | |
download | rneovim-1dcda865591b9bdda2fec1a1860efb4df56ea533.tar.gz rneovim-1dcda865591b9bdda2fec1a1860efb4df56ea533.tar.bz2 rneovim-1dcda865591b9bdda2fec1a1860efb4df56ea533.zip |
fix(column): clamp line number for legacy signs
Problem: Legacy :sign API still allows placing signs beyond the end of
the buffer. This is unaccounted for by the signcolumn tracking
logic and is disallowed in general for the extmark API which
implements it now.
Solution: Clamp legacy sign line number to the length of the buffer.
Diffstat (limited to 'test/old')
-rw-r--r-- | test/old/testdir/test_signs.vim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/old/testdir/test_signs.vim b/test/old/testdir/test_signs.vim index d7baa7e870..69fefccb3f 100644 --- a/test/old/testdir/test_signs.vim +++ b/test/old/testdir/test_signs.vim @@ -89,8 +89,9 @@ func Test_sign() " Place a sign without specifying the filename or buffer sign place 77 line=9 name=Sign2 let a=execute('sign place') + " Nvim: sign line clamped to buffer length call assert_equal("\n--- Signs ---\nSigns for [NULL]:\n" . - \ " line=9 id=77 name=Sign2 priority=10\n", a) + \ " line=4 id=77 name=Sign2 priority=10\n", a) sign unplace * " Check :jump with file=... @@ -799,10 +800,11 @@ func Test_sign_group() set buftype=nofile sign place 25 line=76 name=sign1 priority=99 file=foo let a = execute('sign place') + " Nvim: sign line clamped to buffer length call assert_equal("\n--- Signs ---\nSigns for Xsign:\n" . \ " line=10 id=5 name=sign1 priority=10\n" . \ "Signs for foo:\n" . - \ " line=76 id=25 name=sign1 priority=99\n", a) + \ " line=1 id=25 name=sign1 priority=99\n", a) close bwipe foo |