mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
vim-patch:9.1.1203: matchparen keeps cursor on case label in sh filetype (#32900)
Problem: matchparen keeps cursor on case label in sh filetype
(@categorical, after 9.1.1187).
Solution: Use :defer so that cursor is always restored, remove checks
for older Vims, finish early if Vim does not support :defer
fixes: vim/vim#16887
closes: vim/vim#16888
47071c6076
This commit is contained in:
@@ -4,6 +4,7 @@ local Screen = require('test.functional.ui.screen')
|
||||
local clear = n.clear
|
||||
local exec = n.exec
|
||||
local feed = n.feed
|
||||
local poke_eventloop = n.poke_eventloop
|
||||
|
||||
describe('matchparen', function()
|
||||
before_each(clear)
|
||||
@@ -238,5 +239,26 @@ describe('matchparen', function()
|
||||
{1:~ }|*2
|
||||
|
|
||||
]])
|
||||
-- Send keys one by one so that CursorMoved is triggered.
|
||||
for _, c in ipairs({ 'A', ' ', 'f', 'o', 'o', 'b', 'a', 'r' }) do
|
||||
feed(c)
|
||||
poke_eventloop()
|
||||
end
|
||||
screen:expect([[
|
||||
{18:#!/bin/sh} |
|
||||
{25:SUSUWU_PRINT() (} |
|
||||
{15:case} {15:"}{100:${LEVEL}}{15:"} {15:in} |
|
||||
{15:"}{100:$SUSUWU_SH_NOTICE}{15:")} foobar^ |
|
||||
{100:${SUSUWU_S}} {15:&&} {15:return} {26:1} |
|
||||
{15:;;} |
|
||||
{15:"}{100:$SUSUWU_SH_DEBUG}{15:")} |
|
||||
{100:(}{15:!} {100:${SUSUWU_VERBOSE})} {15:&&} {15:return} {26:1} |
|
||||
{15:;;} |
|
||||
{15:esac} |
|
||||
{18:# snip} |
|
||||
{25:)} |
|
||||
{1:~ }|*2
|
||||
{5:-- INSERT --} |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user