diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-31 08:35:08 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 08:35:08 +0800 |
commit | 839d919098ed2cf3dfb93b6337a3d2ea2bd210a0 (patch) | |
tree | 3095a377dcdcf8a50f71d4cf5d9aa98d5412d776 /test/functional | |
parent | 5d49542b561e7f4826e28f7a0aeca94d47b3e0b7 (diff) | |
download | rneovim-839d919098ed2cf3dfb93b6337a3d2ea2bd210a0.tar.gz rneovim-839d919098ed2cf3dfb93b6337a3d2ea2bd210a0.tar.bz2 rneovim-839d919098ed2cf3dfb93b6337a3d2ea2bd210a0.zip |
vim-patch:9.0.1825: wrong cursor position with virt text and 'linebreak' (#24957)
Problem: Wrong cursor position with virtual text before a whitespace
character and 'linebreak'.
Solution: Always set "col_adj" to "size - 1" and apply 'linebreak' after
adding the size of 'breakindent' and 'showbreak'.
closes: vim/vim#12956
https://github.com/vim/vim/commit/6e55e85f92aff43c1b3cb564201440f3552d63f0
N/A patches:
vim-patch:9.0.1826: keytrans() doesn't translate recorded key typed in a GUI
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/ui/decorations_spec.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/functional/ui/decorations_spec.lua b/test/functional/ui/decorations_spec.lua index 63f8c1e82c..ba8d548a57 100644 --- a/test/functional/ui/decorations_spec.lua +++ b/test/functional/ui/decorations_spec.lua @@ -3217,6 +3217,33 @@ describe('decorations: inline virtual text', function() | ]]} end) + + it('before a space with linebreak', function() + screen:try_resize(50, 6) + exec([[ + setlocal linebreak showbreak=+ breakindent breakindentopt=shift:2 + call setline(1, repeat('a', 50) .. ' ' .. repeat('c', 45)) + normal! $ + ]]) + meths.buf_set_extmark(0, ns, 0, 50, { virt_text = { { ('b'):rep(10) } }, virt_text_pos = 'inline' }) + screen:expect{grid=[[ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + {1:+}bbbbbbbbbb | + {1:+}cccccccccccccccccccccccccccccccccccccccccccc^c | + {1:~ }| + {1:~ }| + | + ]]} + feed('05x$') + screen:expect{grid=[[ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbb| + {1:+}bbbbb | + {1:+}cccccccccccccccccccccccccccccccccccccccccccc^c | + {1:~ }| + {1:~ }| + | + ]]} + end) end) describe('decorations: virtual lines', function() |