aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_virtualedit.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-10-21 02:04:35 +0200
committerJustin M. Keyes <justinkz@gmail.com>2017-10-21 02:18:00 +0200
commit82b8382abe6c533fbdd01529cfc93a8d1c5231e2 (patch)
tree8ba892eed36830b4a2d716b25f93579d9537bf0f /src/nvim/testdir/test_virtualedit.vim
parent6338199b76e661e85e4061122be99c57bf198cf8 (diff)
downloadrneovim-82b8382abe6c533fbdd01529cfc93a8d1c5231e2.tar.gz
rneovim-82b8382abe6c533fbdd01529cfc93a8d1c5231e2.tar.bz2
rneovim-82b8382abe6c533fbdd01529cfc93a8d1c5231e2.zip
vim-patch:8.0.0962
closes #6726 Problem: Crash with virtualedit and joining lines. (Joshua T Corbin, Neovim #6726) Solution: When using a mark check that coladd is valid. https://github.com/vim/vim/commit/9aa156912867c05e0a6480925afe11c590378f09
Diffstat (limited to 'src/nvim/testdir/test_virtualedit.vim')
-rw-r--r--src/nvim/testdir/test_virtualedit.vim31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_virtualedit.vim b/src/nvim/testdir/test_virtualedit.vim
new file mode 100644
index 0000000000..da143c518f
--- /dev/null
+++ b/src/nvim/testdir/test_virtualedit.vim
@@ -0,0 +1,31 @@
+" Tests for 'virtualedit'.
+
+func Test_yank_move_change()
+ split
+ call setline(1, [
+ \ "func foo() error {",
+ \ "\tif n, err := bar();",
+ \ "\terr != nil {",
+ \ "\t\treturn err",
+ \ "\t}",
+ \ "\tn = n * n",
+ \ ])
+ set virtualedit=all
+ set ts=4
+ function! MoveSelectionDown(count) abort
+ normal! m`
+ silent! exe "'<,'>move'>+".a:count
+ norm! ``
+ endfunction
+
+ xmap ]e :<C-U>call MoveSelectionDown(v:count1)<CR>
+ 2
+ normal 2gg
+ normal J
+ normal jVj
+ normal ]e
+ normal ce
+ bwipe!
+ set virtualedit=
+ set ts=8
+endfunc