]> granicus.if.org Git - vim/commitdiff
patch 8.2.1976: cannot backspace in prompt buffer after using cursor-left v8.2.1976
authorBram Moolenaar <Bram@vim.org>
Wed, 11 Nov 2020 19:52:40 +0000 (20:52 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 11 Nov 2020 19:52:40 +0000 (20:52 +0100)
Problem:    Cannot backspace in prompt buffer after using cursor-left. (Maxim
            Kim)
Solution:   Ignore "arrow_used" in a prompt buffer. (closes #7281)

src/edit.c
src/testdir/test_prompt_buffer.vim
src/version.c

index 73e8337521c52a0cefc7463991c44d85e05c81da..934f6c1983d45c1fdf315ba9eee0972a4577d017 100644 (file)
@@ -3946,8 +3946,11 @@ ins_bs(
 #endif
                ((curwin->w_cursor.lnum == 1 && curwin->w_cursor.col == 0)
                    || (!can_bs(BS_START)
-                       && (arrow_used
-                           || (curwin->w_cursor.lnum == Insstart_orig.lnum
+                       && ((arrow_used
+#ifdef FEAT_JOB_CHANNEL
+                               && !bt_prompt(curbuf)
+#endif
+                       ) || (curwin->w_cursor.lnum == Insstart_orig.lnum
                                && curwin->w_cursor.col <= Insstart_orig.col)))
                    || (!can_bs(BS_INDENT) && !arrow_used && ai_col > 0
                                         && curwin->w_cursor.col <= ai_col)
index 8c266ebe6f228b94c128cd4aaee32e431967ba76..00b97f8c86cc36e5e0a756edee7bcebe07f39cc0 100644 (file)
@@ -122,6 +122,14 @@ func Test_prompt_garbage_collect()
   bwipe!
 endfunc
 
+func Test_prompt_backspace()
+  new
+  set buftype=prompt
+  call feedkeys("A123456\<Left>\<BS>\<Esc>", 'xt')
+  call assert_equal('% 12346', getline(1))
+  bwipe!
+endfunc
+
 " Test for editing the prompt buffer
 func Test_prompt_buffer_edit()
   new
index 872c25a9b154821a744dc4f6381b2f7ba7ad028f..28f95cfbb6eed7bee9647a2be2bfa270081fc649 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1976,
 /**/
     1975,
 /**/