mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-03 17:24:29 +00:00 
			
		
		
		
	fix(completion): prevent K_LUA from closing pum
This commit is contained in:
		@@ -3620,7 +3620,7 @@ static bool ins_compl_prep(int c)
 | 
			
		||||
  // Ignore end of Select mode mapping and mouse scroll buttons.
 | 
			
		||||
  if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP
 | 
			
		||||
      || c == K_MOUSELEFT || c == K_MOUSERIGHT || c == K_EVENT
 | 
			
		||||
      || c == K_COMMAND) {
 | 
			
		||||
      || c == K_COMMAND || c == K_LUA) {
 | 
			
		||||
    return retval;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -820,6 +820,16 @@ describe('nvim_set_keymap, nvim_del_keymap', function()
 | 
			
		||||
    eq(99, exec_lua[[return SomeValue]])
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('does not reset pum in lua mapping', function()
 | 
			
		||||
    eq(0, exec_lua [[
 | 
			
		||||
      VisibleCount = 0
 | 
			
		||||
      vim.api.nvim_set_keymap ('i', '<F2>', '', {callback = function() VisibleCount = VisibleCount + vim.fn.pumvisible() end})
 | 
			
		||||
      return VisibleCount
 | 
			
		||||
    ]])
 | 
			
		||||
    feed('i<C-X><C-V><F2><F2><esc>')
 | 
			
		||||
    eq(2, exec_lua[[return VisibleCount]])
 | 
			
		||||
  end)
 | 
			
		||||
 | 
			
		||||
  it('can overwrite lua mappings', function()
 | 
			
		||||
    eq(0, exec_lua [[
 | 
			
		||||
      GlobalCount = 0
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user