aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-01-06 13:02:40 +0100
committerGitHub <noreply@github.com>2019-01-06 13:02:40 +0100
commitea7504cf8e22fa96a085704afa424c299f28bed5 (patch)
tree1099166844e22bc3a98009507830debd3e13d039 /src/nvim/testdir
parent072448a2c98c7ac371b7b3398c4826fe5863f04c (diff)
parentfba80f5edc8750860fdfb87842419b8fd8dfeab1 (diff)
downloadrneovim-ea7504cf8e22fa96a085704afa424c299f28bed5.tar.gz
rneovim-ea7504cf8e22fa96a085704afa424c299f28bed5.tar.bz2
rneovim-ea7504cf8e22fa96a085704afa424c299f28bed5.zip
Merge #9459 from janlazo/vim-8.1.0677
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_visual.vim41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_visual.vim b/src/nvim/testdir/test_visual.vim
index 756a455ebd..4a143d665d 100644
--- a/src/nvim/testdir/test_visual.vim
+++ b/src/nvim/testdir/test_visual.vim
@@ -277,3 +277,44 @@ func Test_visual_mode_reset()
set belloff&
endfunc
+
+func Test_Visual_sentence_textobject()
+ new
+ call setline(1, ['First sentence. Second sentence. Third', 'sentence. Fouth sentence'])
+
+ " When start and end of visual area are identical, 'as' or 'is' select
+ " the whole sentence.
+ norm! 1gofdvasy
+ call assert_equal('Second sentence. ', @")
+ norm! 1gofdvisy
+ call assert_equal('Second sentence.', @")
+
+ " When start and end of visual area are not identical, 'as' or 'is'
+ " extend the sentence in direction of the end of the visual area.
+ norm! 1gofdvlasy
+ call assert_equal('d sentence. ', @")
+ norm! gvasy
+ call assert_equal("d sentence. Third\nsentence. ", @")
+
+ norm! 1gofdvlisy
+ call assert_equal('d sentence.', @")
+ norm! gvisy
+ call assert_equal('d sentence. ', @")
+ norm! gvisy
+ call assert_equal("d sentence. Third\nsentence.", @")
+
+ " Extend visual area in opposite direction.
+ norm! 1gofdvhasy
+ call assert_equal(' Second', @")
+ norm! gvasy
+ call assert_equal("First sentence. Second", @")
+
+ norm! 1gofdvhisy
+ call assert_equal('Second', @")
+ norm! gvisy
+ call assert_equal(' Second', @")
+ norm! gvisy
+ call assert_equal('First sentence. Second', @")
+
+ bwipe!
+endfunc