]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0899: default for 'backspace' can be set in C code v9.1.0899
authorLuca Saccarola <github.e41mv@aleeas.com>
Sun, 1 Dec 2024 15:25:53 +0000 (16:25 +0100)
committerChristian Brabandt <cb@256bit.org>
Sun, 1 Dec 2024 15:25:53 +0000 (16:25 +0100)
Problem:  default for 'backspace' can be set in C code
Solution: promote the default for 'backspace' from defaults.vim to the C
          code (Luca Saccarola)

closes: #16143

Signed-off-by: Luca Saccarola <github.e41mv@aleeas.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/defaults.vim
runtime/doc/options.txt
runtime/doc/version9.txt
src/optiondefs.h
src/testdir/test_autocmd.vim
src/testdir/test_digraph.vim
src/testdir/test_ins_complete.vim
src/testdir/test_options.vim
src/version.c

index 82f3358962e899332523f282609217ddf2ea22ad..38b03da11d701f1daf1dc874d32e1c2c15e96bb9 100644 (file)
@@ -1,7 +1,7 @@
 " The default vimrc file.
 "
 " Maintainer:  The Vim Project <https://github.com/vim/vim>
-" Last Change: 2024 Nov 14
+" Last Change: 2024 Dec 01
 " Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 "
 " This is loaded if no vimrc file was found.
@@ -33,9 +33,6 @@ silent! while 0
   set nocompatible
 silent! endwhile
 
-" Allow backspacing over everything in insert mode.
-set backspace=indent,eol,start
-
 set ruler              " show the cursor position all the time
 set showcmd            " display incomplete commands
 
index 05c2d9d4c3ee73bd058710892ea25d0ca18c9184..764b4ab337ab9052a5903cbcb78ca66597d60b28 100644 (file)
@@ -1069,8 +1069,7 @@ A jump table for the options with a short description can be found at |Q_op|.
        done with ":syntax on".
 
                                                        *'backspace'* *'bs'*
-'backspace' 'bs'       string  (default "", set to "indent,eol,start"
-                                                           in |defaults.vim|)
+'backspace' 'bs'       string  (Vim default: "indent,eol,start", Vi default: "")
                        global
        Influences the working of <BS>, <Del>, CTRL-W and CTRL-U in Insert
        mode.  This is a list of items, separated by commas.  Each item allows
index b9977a9f2c2a6abb66011c862d3c663747fac23d..2aadcd3f4fcf3c1412824a9f344f5c4bcbf63a17 100644 (file)
@@ -41611,6 +41611,8 @@ Changed~
 - 'rulerformat' now supports the |stl-%!| item
 - the default 'history' option value has been increased to 200 and removed
   from |defaults.vim|
+- the default 'backspace' option for Vim has been set to "indent,eol,start"
+  and removed from |defaults.vim|
 
                                                        *added-9.2*
 Added ~
index ca085d42c27ca0aee5bad9c5aea733ce837a1f37..2959232d0697f841e3af241ada12a25a125211e2 100644 (file)
@@ -414,9 +414,9 @@ static struct vimoption options[] =
                            (char_u *)"light",
 #endif
                                            (char_u *)0L} SCTX_INIT},
-    {"backspace",   "bs",   P_STRING|P_VI_DEF|P_VIM|P_ONECOMMA|P_NODUP,
+    {"backspace",   "bs",   P_STRING|P_VIM|P_ONECOMMA|P_NODUP,
                            (char_u *)&p_bs, PV_NONE, did_set_backspace, expand_set_backspace,
-                           {(char_u *)"", (char_u *)0L} SCTX_INIT},
+                           {(char_u *)"", (char_u *)"indent,eol,start"} SCTX_INIT},
     {"backup",     "bk",   P_BOOL|P_VI_DEF|P_VIM,
                            (char_u *)&p_bk, PV_NONE, NULL, NULL,
                            {(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
index 531aa6b96bc873d9a1f645db562eeeb221f5c75c..d6f8ef4ceead7ccc34c3a1d61b229259ff3722f2 100644 (file)
@@ -1279,8 +1279,8 @@ func Test_OptionSet()
   call assert_equal(g:opt[0], g:opt[1])
 
   " 14: Setting option backspace through :let"
-  let g:options = [['backspace', '', '', '', 'eol,indent,start', 'global', 'set']]
-  let &bs = "eol,indent,start"
+  let g:options = [['backspace', 'indent,eol,start', 'indent,eol,start', 'indent,eol,start', '', 'global', 'set']]
+  let &bs = ''
   call assert_equal([], g:options)
   call assert_equal(g:opt[0], g:opt[1])
 
index 3312faf31f62d5bf45a00f45204f5f6ddb4c0403..16eb0b1583fd711b911a0bb277f8f59c2ad7b2bd 100644 (file)
@@ -250,9 +250,12 @@ func Test_digraphs_option()
   call Put_Dig_BS("P","=")
   call assert_equal(['Р']+repeat(["₽"],2)+['П'], getline(line('.')-3,line('.')))
   " Not a digraph: this is different from <c-k>!
+  let _bs = &bs
+  set bs=
   call Put_Dig_BS("a","\<bs>")
   call Put_Dig_BS("\<bs>","a")
   call assert_equal(['','a'], getline(line('.')-1,line('.')))
+  let &bs = _bs
   " Grave
   call Put_Dig_BS("a","!")
   call Put_Dig_BS("!","e")
index fd4c7cded527df6e78a12bea504d483c36e3efa0..7829f79fbba01c91cdd3a993d82aaf6f48572a65 100644 (file)
@@ -1431,7 +1431,7 @@ func Test_complete_item_refresh_always()
   set completefunc=Tcomplete
   exe "normal! iup\<C-X>\<C-U>\<BS>\<BS>\<BS>\<BS>\<BS>"
   call assert_equal('up', getline(1))
-  call assert_equal(2, g:CallCount)
+  call assert_equal(6, g:CallCount)
   set completeopt&
   set completefunc&
   bw!
index fa75204cfc2ad06d921944a18f1d786feb836bcc..cd66cdfaeb2d0b8367e5c9d3fe6ea5b4797a55eb 100644 (file)
@@ -486,7 +486,7 @@ func Test_set_completion_string_values()
   " but don't exhaustively validate their results.
   call assert_equal('single', getcompletion('set ambw=', 'cmdline')[0])
   call assert_match('light\|dark', getcompletion('set bg=', 'cmdline')[1])
-  call assert_equal('indent', getcompletion('set backspace=', 'cmdline')[0])
+  call assert_equal('indent,eol,start', getcompletion('set backspace=', 'cmdline')[0])
   call assert_equal('yes', getcompletion('set backupcopy=', 'cmdline')[1])
   call assert_equal('backspace', getcompletion('set belloff=', 'cmdline')[1])
   call assert_equal('min:', getcompletion('set briopt=', 'cmdline')[1])
index f83e5976de4f6021bb4e747e244440ad937eaa62..7558bdc1b14ae08a2b023b4a1f79c250c67c32fb 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    899,
 /**/
     898,
 /**/