diff options
author | Ibby <33922797+SleepySwords@users.noreply.github.com> | 2023-03-28 01:23:21 +1100 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-05-22 13:49:42 +0200 |
commit | be273c3a23cf65665e843cfb13fd5319657cc5c2 (patch) | |
tree | 7a253bea0c911ab5a90a5da098a1d8f6f02dd760 /src/nvim/plines.c | |
parent | c5bf838f8aa51709f8d7ee81cf2b2a6479c77ad7 (diff) | |
download | rneovim-be273c3a23cf65665e843cfb13fd5319657cc5c2.tar.gz rneovim-be273c3a23cf65665e843cfb13fd5319657cc5c2.tar.bz2 rneovim-be273c3a23cf65665e843cfb13fd5319657cc5c2.zip |
vim-patch:9.0.0205: cursor in wrong position when inserting after virtual text
Problem: Cursor in wrong position when inserting after virtual text. (Ben
Jackson)
Solution: Put the cursor after the virtual text, where the text will be
inserted. (closes vim/vim#10914)
https://github.com/vim/vim/commit/28c9f895716cfa8f1220bc41b72a534c0e10cabe
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/plines.c')
-rw-r--r-- | src/nvim/plines.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nvim/plines.c b/src/nvim/plines.c index 2df9c23902..3b4883d5c2 100644 --- a/src/nvim/plines.c +++ b/src/nvim/plines.c @@ -325,6 +325,7 @@ void init_chartabsize_arg(chartabsize_T *cts, win_T *wp, linenr_T lnum, colnr_T cts->cts_ptr = ptr; cts->cts_cur_text_width = 0; cts->cts_has_virt_text = false; + cts->cts_has_right_gravity = true; cts->cts_row = lnum - 1; if (cts->cts_row >= 0) { @@ -425,6 +426,7 @@ int win_lbr_chartabsize(chartabsize_T *cts, int *headp) Decoration decor = get_decor(mark); if (decor.virt_text_pos == kVTInline) { cts->cts_cur_text_width += decor.virt_text_width; + cts->cts_has_right_gravity = mt_right(mark); size += decor.virt_text_width; if (*s == TAB) { // tab size changes because of the inserted text |