aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-26 07:32:45 +0800
committerGitHub <noreply@github.com>2022-11-26 07:32:45 +0800
commitd38da27f1e1e4d8f2ff0af94b32aa531a9183255 (patch)
tree95548679cbdd77cdc5e62c52efab0a15a9bec1e0 /src/nvim/testdir
parent29b80f6f2e9391b5d78390f65d09f00f73829310 (diff)
downloadrneovim-d38da27f1e1e4d8f2ff0af94b32aa531a9183255.tar.gz
rneovim-d38da27f1e1e4d8f2ff0af94b32aa531a9183255.tar.bz2
rneovim-d38da27f1e1e4d8f2ff0af94b32aa531a9183255.zip
vim-patch:9.0.0950: the pattern "\_s\zs" matches at EOL (#21192)
Problem: The pattern "\_s\zs" matches at EOL. Solution: Make the pattern "\_s\zs" match at the start of the next line. (closes vim/vim#11617) https://github.com/vim/vim/commit/c96311b5be307f5a1d1b20a0ec930d63964e7335 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_search.vim26
1 files changed, 24 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_search.vim b/src/nvim/testdir/test_search.vim
index 96ed35718f..0702e89ebb 100644
--- a/src/nvim/testdir/test_search.vim
+++ b/src/nvim/testdir/test_search.vim
@@ -1816,7 +1816,7 @@ func Test_search_smartcase_utf8()
set ignorecase& smartcase&
let &encoding = save_enc
- close!
+ bwipe!
endfunc
" Test searching past the end of a file
@@ -1825,7 +1825,29 @@ func Test_search_past_eof()
call setline(1, ['Line'])
exe "normal /\\n\\zs\<CR>"
call assert_equal([1, 4], [line('.'), col('.')])
- close!
+ bwipe!
+endfunc
+
+" Test setting the start of the match and still finding a next match in the
+" same line.
+func Test_search_set_start_same_line()
+ new
+ set cpo-=c
+
+ call setline(1, ['1', '2', '3 .', '4', '5'])
+ exe "normal /\\_s\\zs\\S\<CR>"
+ call assert_equal([2, 1], [line('.'), col('.')])
+ exe 'normal n'
+ call assert_equal([3, 1], [line('.'), col('.')])
+ exe 'normal n'
+ call assert_equal([3, 3], [line('.'), col('.')])
+ exe 'normal n'
+ call assert_equal([4, 1], [line('.'), col('.')])
+ exe 'normal n'
+ call assert_equal([5, 1], [line('.'), col('.')])
+
+ set cpo+=c
+ bwipe!
endfunc
" Test for various search offsets