diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-07-17 09:20:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-17 01:20:41 +0000 |
commit | 4025c2aa5f788ba2772d8f0dd3f7add499333878 (patch) | |
tree | 35d9d1d74e4cc38bd4c6895124d2d6d5b0c03213 | |
parent | f9a49fab0c9062cb0e5ed8fbb26579efda0e7a30 (diff) | |
download | rneovim-4025c2aa5f788ba2772d8f0dd3f7add499333878.tar.gz rneovim-4025c2aa5f788ba2772d8f0dd3f7add499333878.tar.bz2 rneovim-4025c2aa5f788ba2772d8f0dd3f7add499333878.zip |
vim-patch:8.2.0281: two placed signs in the same line are not combined (#29757)
Problem: Two placed signs in the same line are not combined. E.g. in the
terminal debugger a breakpoint and the PC cannot be both be
displayed.
Solution: Combine the sign column and line highlight attributes.
https://github.com/vim/vim/commit/a2f6e42ded067df8ee682c15aa246491a389b1a0
Nvim already does this in decor_redraw_signs().
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-rw-r--r-- | test/functional/legacy/signs_spec.lua | 13 | ||||
-rw-r--r-- | test/old/testdir/test_signs.vim | 9 |
2 files changed, 20 insertions, 2 deletions
diff --git a/test/functional/legacy/signs_spec.lua b/test/functional/legacy/signs_spec.lua index 61eba1e559..27145f4c91 100644 --- a/test/functional/legacy/signs_spec.lua +++ b/test/functional/legacy/signs_spec.lua @@ -31,6 +31,7 @@ describe('signs', function() call setline(1, [repeat('x', 75), 'mmmm', 'yyyy']) call cursor(2,1) sign define s1 texthl=Search text==> + sign define s2 linehl=Pmenu redraw sign place 10 line=2 name=s1 ]]) @@ -54,8 +55,20 @@ describe('signs', function() | ]]) + -- Also place a line HL sign + command('sign place 11 line=2 name=s2') + screen:expect([[ + {7: }xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| + {7: }xx | + {10:-)}{4:^mmmm }| + {7: }yyyy | + {1:~ }| + | + ]]) + -- update cursor position calculation feed('lh') + command('sign unplace 11') command('sign unplace 10') screen:expect([[ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx| diff --git a/test/old/testdir/test_signs.vim b/test/old/testdir/test_signs.vim index 60a0448b76..1bb2ddd978 100644 --- a/test/old/testdir/test_signs.vim +++ b/test/old/testdir/test_signs.vim @@ -1816,6 +1816,7 @@ func Test_sign_cursor_position() call setline(1, [repeat('x', 75), 'mmmm', 'yyyy']) call cursor(2,1) sign define s1 texthl=Search text==> + sign define s2 linehl=Pmenu redraw sign place 10 line=2 name=s1 END @@ -1827,11 +1828,15 @@ func Test_sign_cursor_position() call term_sendkeys(buf, ":sign define s1 text=-)\<CR>") call VerifyScreenDump(buf, 'Test_sign_cursor_2', {}) + " Also place a line HL sign + call term_sendkeys(buf, ":sign place 11 line=2 name=s2\<CR>") + call VerifyScreenDump(buf, 'Test_sign_cursor_3', {}) + " update cursor position calculation call term_sendkeys(buf, "lh") + call term_sendkeys(buf, ":sign unplace 11\<CR>") call term_sendkeys(buf, ":sign unplace 10\<CR>") - call VerifyScreenDump(buf, 'Test_sign_cursor_3', {}) - + call VerifyScreenDump(buf, 'Test_sign_cursor_4', {}) " clean up call StopVimInTerminal(buf) |