diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-12-18 09:04:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-18 09:04:32 +0800 |
commit | f7c42433c55203a1421276b33b6d3fedd652ca7e (patch) | |
tree | f452d6044948242f34fdce0480fe938392724237 /test/functional/ui/mode_spec.lua | |
parent | 51c380238cd23c5e6e050dfb379ae6b30bef032c (diff) | |
download | rneovim-f7c42433c55203a1421276b33b6d3fedd652ca7e.tar.gz rneovim-f7c42433c55203a1421276b33b6d3fedd652ca7e.tar.bz2 rneovim-f7c42433c55203a1421276b33b6d3fedd652ca7e.zip |
vim-patch:9.1.0940: Wrong cursor shape with "gq" and 'indentexpr' executes :normal (#31616)
Problem: Wrong cursor shape with "gq" and 'indentexpr' executes :normal
Solution: Update cursor and mouse shape after restoring old_State.
(zeertzjq)
closes: vim/vim#16241
Solution: Update cursor and mouse shape after restoring old_State.
https://github.com/vim/vim/commit/6c3027744e71937b24829135ba072090d7d52bc3
Diffstat (limited to 'test/functional/ui/mode_spec.lua')
-rw-r--r-- | test/functional/ui/mode_spec.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/ui/mode_spec.lua b/test/functional/ui/mode_spec.lua index 8c6a284cd6..69b38f3ff3 100644 --- a/test/functional/ui/mode_spec.lua +++ b/test/functional/ui/mode_spec.lua @@ -94,6 +94,46 @@ describe('ui mode_change event', function() } end) + -- oldtest: Test_indent_norm_with_gq() + it('is restored to Normal mode after "gq" indents using :normal #12309', function() + screen:try_resize(60, 6) + n.exec([[ + func Indent() + exe "normal! \<Ignore>" + return 0 + endfunc + + setlocal indentexpr=Indent() + call setline(1, [repeat('a', 80), repeat('b', 80)]) + ]]) + + feed('ggVG') + screen:expect { + grid = [[ + {17:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}| + {17:aaaaaaaaaaaaaaaaaaaa} | + ^b{17:bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb}| + {17:bbbbbbbbbbbbbbbbbbbb} | + {1:~ }| + {5:-- VISUAL LINE --} | + ]], + mode = 'visual', + } + + feed('gq') + screen:expect { + grid = [[ + aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| + aaaaaaaaaaaaaaaaaaaa | + ^bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb| + bbbbbbbbbbbbbbbbbbbb | + {1:~ }| + | + ]], + mode = 'normal', + } + end) + it('works in insert mode', function() feed('i') screen:expect { |