mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #4712 from jamessan/runtime-patches
vim-patch:{40a346d,89b24fc,27a82e3}
This commit is contained in:
commit
5185b75f7e
1
.gitignore
vendored
1
.gitignore
vendored
@ -28,6 +28,7 @@ tags
|
||||
/src/nvim/testdir/tiny.vim
|
||||
/src/nvim/testdir/test*.out
|
||||
/src/nvim/testdir/test.log
|
||||
/src/nvim/testdir/messages
|
||||
/src/nvim/testdir/viminfo
|
||||
/src/nvim/testdir/test.ok
|
||||
/src/nvim/testdir/*.failed
|
||||
|
@ -673,7 +673,7 @@ static int included_patches[] = {
|
||||
// 1008 NA
|
||||
// 1007,
|
||||
1006,
|
||||
// 1005,
|
||||
// 1005 NA,
|
||||
// 1004 NA,
|
||||
// 1003 NA,
|
||||
// 1002 NA,
|
||||
|
67
test/functional/legacy/backspace_opt_spec.lua
Normal file
67
test/functional/legacy/backspace_opt_spec.lua
Normal file
@ -0,0 +1,67 @@
|
||||
local helpers = require('test.functional.helpers')
|
||||
local call, clear = helpers.call, helpers.clear
|
||||
local source, eq, nvim = helpers.source, helpers.eq, helpers.meths
|
||||
|
||||
describe("test 'backspace' settings", function()
|
||||
before_each(function()
|
||||
clear()
|
||||
|
||||
source([[
|
||||
func Exec(expr)
|
||||
let str=''
|
||||
try
|
||||
exec a:expr
|
||||
catch /.*/
|
||||
let str=v:exception
|
||||
endtry
|
||||
return str
|
||||
endfunc
|
||||
|
||||
func Test_backspace_option()
|
||||
set backspace=
|
||||
call assert_equal('', &backspace)
|
||||
set backspace=indent
|
||||
call assert_equal('indent', &backspace)
|
||||
set backspace=eol
|
||||
call assert_equal('eol', &backspace)
|
||||
set backspace=start
|
||||
call assert_equal('start', &backspace)
|
||||
" Add the value
|
||||
set backspace=
|
||||
set backspace=indent
|
||||
call assert_equal('indent', &backspace)
|
||||
set backspace+=eol
|
||||
call assert_equal('indent,eol', &backspace)
|
||||
set backspace+=start
|
||||
call assert_equal('indent,eol,start', &backspace)
|
||||
" Delete the value
|
||||
set backspace-=indent
|
||||
call assert_equal('eol,start', &backspace)
|
||||
set backspace-=start
|
||||
call assert_equal('eol', &backspace)
|
||||
set backspace-=eol
|
||||
call assert_equal('', &backspace)
|
||||
" Check the error
|
||||
call assert_equal(0, match(Exec('set backspace=ABC'), '.*E474'))
|
||||
call assert_equal(0, match(Exec('set backspace+=def'), '.*E474'))
|
||||
" NOTE: Vim doesn't check following error...
|
||||
"call assert_equal(0, match(Exec('set backspace-=ghi'), '.*E474'))
|
||||
|
||||
" Check backwards compatibility with version 5.4 and earlier
|
||||
set backspace=0
|
||||
call assert_equal('0', &backspace)
|
||||
set backspace=1
|
||||
call assert_equal('1', &backspace)
|
||||
set backspace=2
|
||||
call assert_equal('2', &backspace)
|
||||
call assert_false(match(Exec('set backspace=3'), '.*E474'))
|
||||
call assert_false(match(Exec('set backspace=10'), '.*E474'))
|
||||
endfunc
|
||||
]])
|
||||
end)
|
||||
|
||||
it('works', function()
|
||||
call('Test_backspace_option')
|
||||
eq({}, nvim.get_vvar('errors'))
|
||||
end)
|
||||
end)
|
Loading…
Reference in New Issue
Block a user