0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.1.0899: default for 'backspace' can be set in C code

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>
This commit is contained in:
Luca Saccarola
2024-12-01 16:25:53 +01:00
committed by Christian Brabandt
parent c74a87eea2
commit 959ef61430
9 changed files with 15 additions and 12 deletions

View 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},

View 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])

View 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")

View 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!

View 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])

View File

@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
899,
/**/
898,
/**/