From 968cd1ed933c039b8d60b0110bc6b539c71e387d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 16 Feb 2023 07:25:16 +0800 Subject: vim-patch:9.0.1309: scrolling two lines with even line count and 'scrolloff' set Problem: Scrolling two lines with even line count and 'scrolloff' set. Solution: Adjust how the topline is computed. (closes vim/vim#10545) https://github.com/vim/vim/commit/1d6539cf36a7b6d1afe76fb6316fe662f543bf60 Cherry-pick test_scroll_opt.vim changes from patch 8.2.1432. Co-authored-by: Bram Moolenaar --- test/functional/legacy/search_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/legacy/search_spec.lua') diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 3f1f85cf28..4228940eda 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -290,8 +290,8 @@ describe('search cmdline', function() -- First match feed('/thei') screen:expect([[ + 3 the | 4 {inc:thei}r | - 5 there | /thei^ | ]]) -- Match from initial cursor position when modifying search -- cgit From 8f9c5ee5ef298883e6de1a3a9c73b348b6398404 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 12 Aug 2023 06:32:13 +0800 Subject: vim-patch:9.0.1691: wrong viewport restored for incsearch and smoothscroll (#24667) Problem: wrong viewport restored for incsearch and smoothscroll Solution: Save and restore skipcol as well closes: vim/vim#12713 https://github.com/vim/vim/commit/7b7b4cb6f274e7bace127107b0d2752133c4020b --- test/functional/legacy/search_spec.lua | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'test/functional/legacy/search_spec.lua') diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index 4228940eda..e2544a8405 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -642,7 +642,7 @@ describe('search cmdline', function() end) -- oldtest: Test_incsearch_substitute_dump2() - it('detects empty pattern properly vim-patch:8.2.2295', function() + it('incsearch detects empty pattern properly vim-patch:8.2.2295', function() screen:try_resize(70, 6) exec([[ set incsearch hlsearch scrolloff=0 @@ -675,6 +675,37 @@ describe('search cmdline', function() :1,5s/\v|^ | ]]) end) + + -- oldtest: Test_incsearch_restore_view() + it('incsearch restores viewport', function() + screen:try_resize(20, 6) + exec([[ + set incsearch nohlsearch + setlocal scrolloff=0 smoothscroll + call setline(1, [join(range(25), ' '), '', '', '', '', 'xxx']) + call feedkeys("2\", 't') + ]]) + local s = [[ + {tilde:<<<} 18 19 20 21 22 2| + ^3 24 | + | + | + | + | + ]] + screen:expect(s) + feed('/xxx') + screen:expect([[ + | + | + | + | + {inc:xxx} | + /xxx^ | + ]]) + feed('') + screen:expect(s) + end) end) describe('Search highlight', function() -- cgit From 7542286d6ad53f8250cd3575e9f3acde5f501c78 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 13 Aug 2023 07:10:24 +0800 Subject: vim-patch:9.0.1697: incsearch test not sufficient (#24683) Problem: incsearch test not sufficient (after 9.0.1691) Solution: add an additional test https://github.com/vim/vim/commit/73b8209266f0cd5c6d4df77b3700172d9c26df31 Co-authored-by: Christ van Willegen --- test/functional/legacy/search_spec.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test/functional/legacy/search_spec.lua') diff --git a/test/functional/legacy/search_spec.lua b/test/functional/legacy/search_spec.lua index e2544a8405..25620f5262 100644 --- a/test/functional/legacy/search_spec.lua +++ b/test/functional/legacy/search_spec.lua @@ -694,7 +694,16 @@ describe('search cmdline', function() | ]] screen:expect(s) - feed('/xxx') + feed('/xx') + screen:expect([[ + | + | + | + | + {inc:xx}x | + /xx^ | + ]]) + feed('x') screen:expect([[ | | -- cgit