aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-05-17 08:47:45 +0800
committerGitHub <noreply@github.com>2022-05-17 08:47:45 +0800
commit6613f58cebde7db4e69709b84d511c32a7c4ce32 (patch)
tree55b36c6b2f52b6f192fdbe36d47bb0469473bede /src/nvim/edit.c
parent07ade91f217a0ed307ca87b4391d803ec0ab61cb (diff)
parent527e861cbb9c47411c4ba86dbdb9fc79bde47452 (diff)
downloadrneovim-6613f58cebde7db4e69709b84d511c32a7c4ce32.tar.gz
rneovim-6613f58cebde7db4e69709b84d511c32a7c4ce32.tar.bz2
rneovim-6613f58cebde7db4e69709b84d511c32a7c4ce32.zip
Merge pull request #18598 from zeertzjq/vim-8.2.4968
vim-patch:8.2.{4121,4968,4969}: invalid memory access
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 357e9184d7..aa77c03b48 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -6770,13 +6770,8 @@ static void stop_insert(pos_T *end_insert_pos, int esc, int nomove)
// <C-S-Right> may have started Visual mode, adjust the position for
// deleted characters.
- if (VIsual_active && VIsual.lnum == curwin->w_cursor.lnum) {
- int len = (int)STRLEN(get_cursor_line_ptr());
-
- if (VIsual.col > len) {
- VIsual.col = len;
- VIsual.coladd = 0;
- }
+ if (VIsual_active) {
+ check_visual_pos();
}
}
}