File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed
Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -3467,10 +3467,13 @@ ins_compl_bs(void)
34673467 mb_ptr_back (line , p );
34683468
34693469 /* Stop completion when the whole word was deleted. For Omni completion
3470- * allow the word to be deleted, we won't match everything. */
3470+ * allow the word to be deleted, we won't match everything.
3471+ * Respect the 'backspace' option. */
34713472 if ((int )(p - line ) - (int )compl_col < 0
34723473 || ((int )(p - line ) - (int )compl_col == 0
3473- && ctrl_x_mode != CTRL_X_OMNI ) || ctrl_x_mode == CTRL_X_EVAL )
3474+ && ctrl_x_mode != CTRL_X_OMNI ) || ctrl_x_mode == CTRL_X_EVAL
3475+ || (!can_bs (BS_START ) && (int )(p - line ) - (int )compl_col
3476+ - compl_length < 0 ))
34743477 return K_BS ;
34753478
34763479 /* Deleted more than what was used to find matches or didn't finish
Original file line number Diff line number Diff line change @@ -511,4 +511,24 @@ func Test_completion_clear_candidate_list()
511511 bw !
512512endfunc
513513
514+ func Test_completion_respect_bs_option ()
515+ new
516+ let li = [" aaa" , " aaa12345" , " aaaabcdef" , " aaaABC" ]
517+
518+ set bs = indent ,eol
519+ call setline (1 , li )
520+ 1
521+ call feedkeys (" A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc> " , " tx" )
522+ call assert_equal (' aaa' , getline (1 ))
523+
524+ % d
525+ set bs = indent ,eol ,start
526+ call setline (1 , li )
527+ 1
528+ call feedkeys (" A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc> " , " tx" )
529+ call assert_equal (' ' , getline (1 ))
530+
531+ bw !
532+ endfunc
533+
514534" vim: shiftwidth = 2 sts = 2 expandtab
Original file line number Diff line number Diff line change @@ -764,6 +764,8 @@ static char *(features[]) =
764764
765765static int included_patches [] =
766766{ /* Add new patch number below this line */
767+ /**/
768+ 319 ,
767769/**/
768770 318 ,
769771/**/
You can’t perform that action at this time.
0 commit comments