Patch 8.0.0319
Problem:    Insert mode completion does not respect "start" in 'backspace'.
Solution:   Check whether backspace can go before where insert started.
            (Hirohito Higashi)
Files:      src/edit.c, src/testdir/test_popup.vim


*** ../vim-8.0.0318/src/edit.c  2017-01-29 17:59:07.872772178 +0100
--- src/edit.c  2017-02-09 17:36:09.266007633 +0100
***************
*** 3467,3476 ****
      mb_ptr_back(line, p);
  
      /* Stop completion when the whole word was deleted.  For Omni completion
!      * allow the word to be deleted, we won't match everything. */
      if ((int)(p - line) - (int)compl_col < 0
            || ((int)(p - line) - (int)compl_col == 0
!               && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL)
        return K_BS;
  
      /* Deleted more than what was used to find matches or didn't finish
--- 3467,3479 ----
      mb_ptr_back(line, p);
  
      /* Stop completion when the whole word was deleted.  For Omni completion
!      * allow the word to be deleted, we won't match everything.
!      * Respect the 'backspace' option. */
      if ((int)(p - line) - (int)compl_col < 0
            || ((int)(p - line) - (int)compl_col == 0
!               && ctrl_x_mode != CTRL_X_OMNI) || ctrl_x_mode == CTRL_X_EVAL
!           || (!can_bs(BS_START) && (int)(p - line) - (int)compl_col
!                                                       - compl_length < 0))
        return K_BS;
  
      /* Deleted more than what was used to find matches or didn't finish
*** ../vim-8.0.0318/src/testdir/test_popup.vim  2017-01-27 21:48:46.960162956 
+0100
--- src/testdir/test_popup.vim  2017-02-09 17:32:34.783629818 +0100
***************
*** 511,514 ****
--- 511,534 ----
    bw!
  endfunc
  
+ func Test_completion_respect_bs_option()
+   new
+   let li = ["aaa", "aaa12345", "aaaabcdef", "aaaABC"]
+ 
+   set bs=indent,eol
+   call setline(1, li)
+   1
+   call feedkeys("A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc>", "tx")
+   call assert_equal('aaa', getline(1))
+ 
+   %d
+   set bs=indent,eol,start
+   call setline(1, li)
+   1
+   call feedkeys("A\<C-X>\<C-N>\<C-P>\<BS>\<BS>\<BS>\<Esc>", "tx")
+   call assert_equal('', getline(1))
+ 
+   bw!
+ endfunc
+ 
  " vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.0.0318/src/version.c       2017-02-09 16:14:47.890179799 +0100
--- src/version.c       2017-02-09 17:34:27.162779654 +0100
***************
*** 766,767 ****
--- 766,769 ----
  {   /* Add new patch number below this line */
+ /**/
+     319,
  /**/

-- 
The most powerful force in the universe is gossip.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui