Mercurial > vim
changeset 30304:f1fe59179180 v9.0.0488
patch 9.0.0488: cursor wrong with virtual text "above" and 'showbreak'
Commit: https://github.com/vim/vim/commit/4c7fd4d68f69b4e420a5448f144f4d57eda22f8c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Sep 17 17:15:33 2022 +0100
patch 9.0.0488: cursor wrong with virtual text "above" and 'showbreak'
Problem: Cursor in wrong position with virtual text "above" and
'showbreak'.
Solution: Take the first character column into account. (closes #11149)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 17 Sep 2022 18:30:04 +0200 |
parents | 05bd2e2a2967 |
children | b00800d36297 |
files | src/charset.c src/testdir/dumps/Test_prop_with_text_above_1c.dump src/testdir/test_textprop.vim src/version.c |
diffstat | 4 files changed, 19 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/charset.c +++ b/src/charset.c @@ -1280,6 +1280,9 @@ win_lbr_chartabsize( numberextra = numberwidth; vcol += numberextra + mb_added; +#ifdef FEAT_PROP_POPUP + vcol -= wp->w_virtcol_first_char; +#endif if (vcol >= (colnr_T)wp->w_width) { vcol -= wp->w_width;
new file mode 100644 --- /dev/null +++ b/src/testdir/dumps/Test_prop_with_text_above_1c.dump @@ -0,0 +1,9 @@ +|f+0&#ffff4012|i|r|s|t| |t|h|i|n|g| |a|b|o|v|e| @42 +|s+0&#ffd7ff255|e|c|o|n|d| |t|h|i|n|g| |a|b|o|v|e| @41 +|o+0&#ffffff0|n>e| |t|w|o| @52 +|t|h|r|e@1| |f|o|u|r| @49 +@3|a+0&#ffff4012|n|o|t|h|e|r| |t|h|i|n|g| @43 +|f+0&#ffffff0|i|v|e| |s|i|x| @51 +|~+0#4040ff13&| @58 +|~| @58 +|:+0#0000000&|s|e|t| |s|h|o|w|b|r|e|a|k|=|>@1| @24|1|,|3|-|1|2|3| @6|A|l@1|
--- a/src/testdir/test_textprop.vim +++ b/src/testdir/test_textprop.vim @@ -2874,6 +2874,11 @@ func Test_props_with_text_above() call term_sendkeys(buf, "g0") call VerifyScreenDump(buf, 'Test_prop_with_text_above_1b', {}) + call term_sendkeys(buf, ":set showbreak=>>\<CR>") + call term_sendkeys(buf, "ggll") + call VerifyScreenDump(buf, 'Test_prop_with_text_above_1c', {}) + call term_sendkeys(buf, ":set showbreak=\<CR>") + call term_sendkeys(buf, "ggI") call VerifyScreenDump(buf, 'Test_prop_with_text_above_2', {}) call term_sendkeys(buf, "inserted \<Esc>")