mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
edit.c: K_EVENT should not hide the popupmenu
Nor should K_FOCUSGAINED and K_FOCUSLOST.
This commit is contained in:
@@ -3084,8 +3084,10 @@ static bool ins_compl_prep(int c)
|
|||||||
|
|
||||||
/* Ignore end of Select mode mapping and mouse scroll buttons. */
|
/* Ignore end of Select mode mapping and mouse scroll buttons. */
|
||||||
if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP
|
if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP
|
||||||
|| c == K_MOUSELEFT || c == K_MOUSERIGHT)
|
|| c == K_MOUSELEFT || c == K_MOUSERIGHT || c == K_EVENT
|
||||||
|
|| c == K_FOCUSGAINED || c == K_FOCUSLOST) {
|
||||||
return retval;
|
return retval;
|
||||||
|
}
|
||||||
|
|
||||||
/* Set "compl_get_longest" when finding the first matches. */
|
/* Set "compl_get_longest" when finding the first matches. */
|
||||||
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET
|
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
local helpers = require('test.functional.helpers')
|
local helpers = require('test.functional.helpers')
|
||||||
|
local Screen = require('test.functional.ui.screen')
|
||||||
local clear, feed = helpers.clear, helpers.feed
|
local clear, feed = helpers.clear, helpers.feed
|
||||||
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
|
local eval, eq, neq = helpers.eval, helpers.eq, helpers.neq
|
||||||
local execute, source, expect = helpers.execute, helpers.source, helpers.expect
|
local execute, source, expect = helpers.execute, helpers.source, helpers.expect
|
||||||
@@ -143,8 +144,60 @@ describe('completion', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('disables folding during completion', function ()
|
it('disables folding during completion', function ()
|
||||||
execute("set foldmethod=indent")
|
execute("set foldmethod=indent")
|
||||||
feed('i<Tab>foo<CR><Tab>bar<Esc>ggA<C-x><C-l>')
|
feed('i<Tab>foo<CR><Tab>bar<Esc>ggA<C-x><C-l>')
|
||||||
eq(-1, eval('foldclosed(1)'))
|
eq(-1, eval('foldclosed(1)'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('popupmenu is not interrupted by events', function ()
|
||||||
|
local screen = Screen.new(40, 8)
|
||||||
|
screen:attach()
|
||||||
|
screen:set_default_attr_ignore({{bold=true, foreground=Screen.colors.Blue}})
|
||||||
|
screen:set_default_attr_ids({
|
||||||
|
[1] = {background = Screen.colors.LightMagenta},
|
||||||
|
[2] = {background = Screen.colors.Grey},
|
||||||
|
[3] = {bold = true},
|
||||||
|
[4] = {bold = true, foreground = Screen.colors.SeaGreen},
|
||||||
|
})
|
||||||
|
|
||||||
|
feed('ifoobar fooegg<cr>f<c-p>')
|
||||||
|
screen:expect([[
|
||||||
|
foobar fooegg |
|
||||||
|
fooegg^ |
|
||||||
|
{1:foobar } |
|
||||||
|
{2:fooegg } |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
{3:-- }{4:match 1 of 2} |
|
||||||
|
]])
|
||||||
|
|
||||||
|
eval('1 + 1')
|
||||||
|
-- popupmenu still visible
|
||||||
|
screen:expect([[
|
||||||
|
foobar fooegg |
|
||||||
|
fooegg^ |
|
||||||
|
{1:foobar } |
|
||||||
|
{2:fooegg } |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
{3:-- }{4:match 1 of 2} |
|
||||||
|
]])
|
||||||
|
|
||||||
|
feed('<c-p>')
|
||||||
|
-- Didn't restart completion: old matches still used
|
||||||
|
screen:expect([[
|
||||||
|
foobar fooegg |
|
||||||
|
foobar^ |
|
||||||
|
{2:foobar } |
|
||||||
|
{1:fooegg } |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
~ |
|
||||||
|
{3:-- }{4:match 2 of 2} |
|
||||||
|
]])
|
||||||
|
end)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user