aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorSean Dewar <seandewar@users.noreply.github.com>2021-11-07 13:12:17 +0000
committerSean Dewar <seandewar@users.noreply.github.com>2021-12-07 11:34:27 +0000
commitd6258a9bad10e97d2582a102750e0e931bb9321a (patch)
treec1ed2bf7d8ce0e34064cb75f8a533538baa9e395 /src/nvim/edit.c
parentc2d0a1041e215634be316c4e824c1b1b2f242e76 (diff)
downloadrneovim-d6258a9bad10e97d2582a102750e0e931bb9321a.tar.gz
rneovim-d6258a9bad10e97d2582a102750e0e931bb9321a.tar.bz2
rneovim-d6258a9bad10e97d2582a102750e0e931bb9321a.zip
vim-patch:8.2.2014: using CTRL-O in a prompt buffer moves cursor to start
Problem: Using CTRL-O in a prompt buffer moves cursor to start of the line. Solution: Do not move the cursor when restarting edit. (closes vim/vim#7330) https://github.com/vim/vim/commit/ee8b787bcd15f63a938243770065e704c9b5c85f Test_prompt_editing is skipped, so edit the Lua test in prompt_buffer_spec.
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index dfdefddc20..9bfb8a9d4a 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -1686,7 +1686,7 @@ static void init_prompt(int cmdchar_todo)
if (cmdchar_todo == 'A') {
coladvance(MAXCOL);
}
- if (cmdchar_todo == 'I' || curwin->w_cursor.col <= (int)STRLEN(prompt)) {
+ if (curwin->w_cursor.col < (colnr_T)STRLEN(prompt)) {
curwin->w_cursor.col = STRLEN(prompt);
}
// Make sure the cursor is in a valid position.