diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-23 18:32:07 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-23 18:50:29 -0400 |
| commit | 42428b3f857b6390084540e82c0e89a49fc4452f (patch) | |
| tree | 05149e89a9f5e5fed3fc4c3495aad2292c01b11b /src/nvim/testdir | |
| parent | 925c153f86908a601a19d0142d8c601cf35df88a (diff) | |
| download | rneovim-42428b3f857b6390084540e82c0e89a49fc4452f.tar.gz rneovim-42428b3f857b6390084540e82c0e89a49fc4452f.tar.bz2 rneovim-42428b3f857b6390084540e82c0e89a49fc4452f.zip | |
vim-patch:8.1.0083: "is" and "as" have trouble with quoted punctuation
Problem: "is" and "as" have trouble with quoted punctuation.
Solution: Check for punctuation before a quote. (Jason Franklin)
https://github.com/vim/vim/commit/8516071124dbb7ad7caa43cc98ae3c57ae093c9e
Diffstat (limited to 'src/nvim/testdir')
| -rw-r--r-- | src/nvim/testdir/test_textobjects.vim | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_textobjects.vim b/src/nvim/testdir/test_textobjects.vim index 52c0c3698e..6a2f5044cc 100644 --- a/src/nvim/testdir/test_textobjects.vim +++ b/src/nvim/testdir/test_textobjects.vim @@ -182,3 +182,78 @@ x norm it q! endfunc + +func Test_sentence() + enew! + call setline(1, 'A sentence. A sentence? A sentence!') + + normal yis + call assert_equal('A sentence.', @") + normal yas + call assert_equal('A sentence. ', @") + + normal ) + + normal yis + call assert_equal('A sentence?', @") + normal yas + call assert_equal('A sentence? ', @") + + normal ) + + normal yis + call assert_equal('A sentence!', @") + normal yas + call assert_equal(' A sentence!', @") + + normal 0 + normal 2yis + call assert_equal('A sentence. ', @") + normal 3yis + call assert_equal('A sentence. A sentence?', @") + normal 2yas + call assert_equal('A sentence. A sentence? ', @") + + %delete _ +endfunc + +func Test_sentence_with_quotes() + enew! + call setline(1, 'A "sentence." A sentence.') + + normal yis + call assert_equal('A "sentence."', @") + normal yas + call assert_equal('A "sentence." ', @") + + normal ) + + normal yis + call assert_equal('A sentence.', @") + normal yas + call assert_equal(' A sentence.', @") + + %delete _ +endfunc + +func! Test_sentence_with_cursor_on_delimiter() + enew! + call setline(1, "A '([sentence.])' A sentence.") + + normal! 15|yis + call assert_equal("A '([sentence.])'", @") + normal! 15|yas + call assert_equal("A '([sentence.])' ", @") + + normal! 16|yis + call assert_equal("A '([sentence.])'", @") + normal! 16|yas + call assert_equal("A '([sentence.])' ", @") + + normal! 17|yis + call assert_equal("A '([sentence.])'", @") + normal! 17|yas + call assert_equal("A '([sentence.])' ", @") + + %delete _ +endfunc |