Merge pull request #4018 from justinmk/vim-35e7594

vim-patch:35e7594
This commit is contained in:
Justin M. Keyes
2016-04-18 04:02:00 -04:00
3 changed files with 53 additions and 50 deletions

View File

@@ -1,34 +0,0 @@
Tests for marks.
STARTTEST
:so small.vim
:" test that a deleted mark is restored after delete-undo-redo-undo
:/^\t/+1
:set nocp viminfo+=nviminfo
madduu
:let a = string(getpos("'a"))
:$put ='Mark after delete-undo-redo-undo: '.a
:''
ENDTEST
textline A
textline B
textline C
STARTTEST
:" test that CTRL-A and CTRL-X updates last changed mark '[, '].
:/^123/
:execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX"
ENDTEST
CTRL-A CTRL-X:
123 123 123
123 123 123
123 123 123
STARTTEST
:g/^STARTTEST/.,/^ENDTEST/d
:wq! test.out
ENDTEST
Results:

View File

@@ -1,16 +0,0 @@
Tests for marks.
textline A
textline B
textline C
CTRL-A CTRL-X:
AAA 123 123
123 XXXXXXX
XXX 123 123
Results:
Mark after delete-undo-redo-undo: [0, 15, 2, 0]

View File

@@ -0,0 +1,53 @@
local helpers = require('test.functional.helpers')
local feed, insert, source = helpers.feed, helpers.insert, helpers.source
local clear, execute, expect = helpers.clear, helpers.execute, helpers.expect
describe('marks', function()
before_each(function()
clear()
end)
it('restores a deleted mark after delete-undo-redo-undo', function()
insert([[
textline A
textline B
textline C
Results:]])
execute([[:/^\t/+1]])
feed([[maddu<C-R>u]])
source([[
let g:a = string(getpos("'a"))
$put ='Mark after delete-undo-redo-undo: '.g:a
]])
expect([=[
textline A
textline B
textline C
Results:
Mark after delete-undo-redo-undo: [0, 3, 2, 0]]=])
end)
it("CTRL-A and CTRL-X updates last changed mark '[, ']", function()
insert([[
CTRL-A CTRL-X:
123 123 123
123 123 123
123 123 123]])
source([[
/^123/
execute "normal! \<C-A>`[v`]rAjwvjw\<C-X>`[v`]rX"]])
expect([=[
CTRL-A CTRL-X:
AAA 123 123
123 XXXXXXX
XXX 123 123]=])
end)
end)