diff src/testdir/test_virtualedit.vim @ 12164:5d82470552ce v8.0.0962

patch 8.0.0962: crash with virtualedit and joining lines commit https://github.com/vim/vim/commit/9aa156912867c05e0a6480925afe11c590378f09 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Aug 19 15:05:32 2017 +0200 patch 8.0.0962: crash with virtualedit and joining lines Problem: Crash with virtualedit and joining lines. (Joshua T Corbin, Neovim https://github.com/vim/vim/issues/6726) Solution: When using a mark check that coladd is valid.
author Christian Brabandt <cb@256bit.org>
date Sat, 19 Aug 2017 15:15:03 +0200
parents
children 57e0b701611e
line wrap: on
line diff
new file mode 100644
--- /dev/null
+++ b/src/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