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 | d391940b9a074bca7ee82460ccaaabf46b5f2ba9 (patch) | |
tree | 28749131a7bf6984e8f41c7d72da6aeaccd3bb69 /src/nvim/edit.c | |
parent | 574a5822023939d534d922eaa345bb7e0633d2b8 (diff) | |
download | rneovim-d391940b9a074bca7ee82460ccaaabf46b5f2ba9.tar.gz rneovim-d391940b9a074bca7ee82460ccaaabf46b5f2ba9.tar.bz2 rneovim-d391940b9a074bca7ee82460ccaaabf46b5f2ba9.zip |
vim-patch:8.2.3227: 'virtualedit' can only be set globally
Problem: 'virtualedit' can only be set globally.
Solution: Make 'virtualedit' global-local. (Gary Johnson, closes vim/vim#8638)
https://github.com/vim/vim/commit/53ba05b09075f14227f9be831a22ed16f7cc26b2
I changed some macros to unsigned integer literals to avoid compiler warnings.
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r-- | src/nvim/edit.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 9efe5a27c4..abf704d554 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -909,7 +909,7 @@ static int insert_handle_key(InsertState *s) ins_ctrl_o(); // don't move the cursor left when 'virtualedit' has "onemore". - if (ve_flags & VE_ONEMORE) { + if (get_ve_flags() & VE_ONEMORE) { ins_at_eol = false; s->nomove = true; } @@ -6905,8 +6905,7 @@ int oneright(void) // move "l" bytes right, but don't end up on the NUL, unless 'virtualedit' // contains "onemore". - if (ptr[l] == NUL - && (ve_flags & VE_ONEMORE) == 0) { + if (ptr[l] == NUL && (get_ve_flags() & VE_ONEMORE) == 0) { return FAIL; } curwin->w_cursor.col += l; @@ -8028,7 +8027,7 @@ static bool ins_esc(long *count, int cmdchar, bool nomove) && !VIsual_active )) && !revins_on) { - if (curwin->w_cursor.coladd > 0 || ve_flags == VE_ALL) { + if (curwin->w_cursor.coladd > 0 || get_ve_flags() == VE_ALL) { oneleft(); if (restart_edit != NUL) { curwin->w_cursor.coladd++; |