diff src/testdir/test_substitute.vim @ 18483:54e5fa1f9cfc v8.1.2236

patch 8.1.2236: ml_get error if pattern matches beyond last line Commit: https://github.com/vim/vim/commit/bb26596242fa7db477e2cd706dd99f9a426b5f71 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Oct 31 04:38:36 2019 +0100 patch 8.1.2236: ml_get error if pattern matches beyond last line Problem: Ml_get error if pattern matches beyond last line. Solution: Adjust position if needed. (Christian Brabandt, closes https://github.com/vim/vim/issues/5139)
author Bram Moolenaar <Bram@vim.org>
date Thu, 31 Oct 2019 04:45:03 +0100
parents 988e5a868b60
children 23fef64352a1
line wrap: on
line diff
--- a/src/testdir/test_substitute.vim
+++ b/src/testdir/test_substitute.vim
@@ -413,6 +413,7 @@ func Run_SubCmd_Tests(tests)
   for t in a:tests
     let start = line('.') + 1
     let end = start + len(t[2]) - 1
+    " TODO: why is there a one second delay the first time we get here?
     exe "normal o" . t[0]
     call cursor(start, 1)
     exe t[1]
@@ -716,3 +717,12 @@ one two
 
   close!
 endfunc
+
+func Test_sub_beyond_end()
+  new
+  call setline(1, '#')
+  let @/ = '^#\n\zs'
+  s///e
+  call assert_equal('#', getline(1))
+  bwipe!
+endfunc