diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-26 04:32:50 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-02 13:11:46 +0200 |
commit | d6050e9bda7f8b080c577100ae94e017dc146c88 (patch) | |
tree | 3696a61193f326414179c87ff30b8d642e32947c /test/functional/legacy/scroll_opt_spec.lua | |
parent | 69af5e8782e601fe9c1e39adf49ce16728719a73 (diff) | |
download | rneovim-d6050e9bda7f8b080c577100ae94e017dc146c88.tar.gz rneovim-d6050e9bda7f8b080c577100ae94e017dc146c88.tar.bz2 rneovim-d6050e9bda7f8b080c577100ae94e017dc146c88.zip |
vim-patch:9.0.0646: with 'smoothscroll' CTRL-E is wrong when 'foldmethod' set
Problem: with 'smoothscroll' set CTRL-E does not work properly when
'foldmethod' is set to "indent". (Yee Cheng Chin)
Solution: Merge the code for scroling with folds and 'smoothscroll'.
(closes vim/vim#11262)
https://github.com/vim/vim/commit/6b2d4ff7148e0b416ba745d20d061e6f7bb53ee7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/functional/legacy/scroll_opt_spec.lua')
-rw-r--r-- | test/functional/legacy/scroll_opt_spec.lua | 80 |
1 files changed, 66 insertions, 14 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index 14dbe0caf9..20976089e2 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -31,11 +31,10 @@ describe('smoothscroll', function() it('works with <C-E> and <C-E>', function() exec([[ call setline(1, [ 'line one', 'word '->repeat(20), 'line three', 'long word '->repeat(7), 'line', 'line', 'line', ]) - set smoothscroll + set smoothscroll scrolloff=5 :5 ]]) - local s0 = [[ - line one | + local s1 = [[ word word word word word word word word | word word word word word word word word | word word word word | @@ -46,10 +45,10 @@ describe('smoothscroll', function() line | line | ~ | + ~ | | ]] - local s1 = [[ - word word word word word word word word | + local s2 = [[ word word word word word word word word | word word word word | line three | @@ -60,10 +59,10 @@ describe('smoothscroll', function() line | ~ | ~ | + ~ | | ]] - local s2 = [[ - word word word word word word word word | + local s3 = [[ word word word word | line three | long word long word long word long word | @@ -74,36 +73,79 @@ describe('smoothscroll', function() ~ | ~ | ~ | + ~ | | ]] - local s3 = [[ - word word word word | + local s4 = [[ line three | long word long word long word long word | long word long word long word | - ^line | line | line | + ^line | + ~ | ~ | ~ | ~ | ~ | | ]] - local s4 = [[ + local s5 = [[ + word word word word | line three | long word long word long word long word | long word long word long word | + line | + line | ^line | + ~ | + ~ | + ~ | + ~ | + | + ]] + local s6 = [[ + word word word word word word word word | + word word word word | + line three | + long word long word long word long word | + long word long word long word | line | line | + ^line | ~ | ~ | ~ | + | + ]] + local s7 = [[ + word word word word word word word word | + word word word word word word word word | + word word word word | + line three | + long word long word long word long word | + long word long word long word | + line | + line | + ^line | ~ | ~ | | ]] + local s8 = [[ + line one | + word word word word word word word word | + word word word word word word word word | + word word word word | + line three | + long word long word long word long word | + long word long word long word | + line | + line | + ^line | + ~ | + | + ]] feed('<C-E>') screen:expect(s1) feed('<C-E>') @@ -113,12 +155,22 @@ describe('smoothscroll', function() feed('<C-E>') screen:expect(s4) feed('<C-Y>') - screen:expect(s3) + screen:expect(s5) feed('<C-Y>') - screen:expect(s2) + screen:expect(s6) feed('<C-Y>') + screen:expect(s7) + feed('<C-Y>') + screen:expect(s8) + exec('set foldmethod=indent') + -- move the cursor so we can reuse the same dumps + feed('5G<C-E>') screen:expect(s1) + feed('<C-E>') + screen:expect(s2) + feed('7G<C-Y>') + screen:expect(s7) feed('<C-Y>') - screen:expect(s0) + screen:expect(s8) end) end) |