diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-01-15 19:21:17 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-01-15 19:21:17 +0800 |
commit | 87e54f123aa1c9c769d3ff35bdd1b5a980ba701c (patch) | |
tree | 1cb66900f9e0a0275c53803ca685872ddb9a294e /src/nvim/ops.c | |
parent | d391940b9a074bca7ee82460ccaaabf46b5f2ba9 (diff) | |
download | rneovim-87e54f123aa1c9c769d3ff35bdd1b5a980ba701c.tar.gz rneovim-87e54f123aa1c9c769d3ff35bdd1b5a980ba701c.tar.bz2 rneovim-87e54f123aa1c9c769d3ff35bdd1b5a980ba701c.zip |
vim-patch:8.2.3280: 'virtualedit' local to buffer is not the best solution
Problem: 'virtualedit' local to buffer is not the best solution.
Solution: Make it window-local. (Gary Johnson, closes vim/vim#8685)
https://github.com/vim/vim/commit/51ad850f5fbafa7aa3f60affa74ec9c9f992c6cc
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r-- | src/nvim/ops.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 74033df313..c845bd3717 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -2197,21 +2197,21 @@ void op_insert(oparg_T *oap, long count1) // already disabled, but still need it when calling // coladvance_force(). // coladvance_force() uses get_ve_flags() to get the 'virtualedit' - // state for the current buffer. To override that state, we need to - // set the buffer-local value of ve_flags rather than the global value. + // state for the current window. To override that state, we need to + // set the window-local value of ve_flags rather than the global value. if (curwin->w_cursor.coladd > 0) { - unsigned old_ve_flags = curbuf->b_ve_flags; + unsigned old_ve_flags = curwin->w_ve_flags; if (u_save_cursor() == FAIL) { return; } - curbuf->b_ve_flags = VE_ALL; + curwin->w_ve_flags = VE_ALL; coladvance_force(oap->op_type == OP_APPEND ? oap->end_vcol + 1 : getviscol()); if (oap->op_type == OP_APPEND) { --curwin->w_cursor.col; } - curbuf->b_ve_flags = old_ve_flags; + curwin->w_ve_flags = old_ve_flags; } // Get the info about the block before entering the text block_prep(oap, &bd, oap->start.lnum, true); |