mirror of
https://github.com/hyzendust/KickestEnd.nvim.git
synced 2026-09-19 04:23:08 +02:00
Fix: in v mode, pressing space was broken
This commit is contained in:
5
init.lua
5
init.lua
@@ -65,13 +65,12 @@ require('lazy').setup({
|
|||||||
config = function(_, opts)
|
config = function(_, opts)
|
||||||
local wk = require 'which-key'
|
local wk = require 'which-key'
|
||||||
wk.setup(opts)
|
wk.setup(opts)
|
||||||
-- Patch which-key's getchar so <Space> acts as a close key,
|
-- Patch which-key's getchar so <Space> acts as a close key, since <Esc> is the only hardcoded one and isn't configurable
|
||||||
-- since <Esc> is the only hardcoded one and isn't configurable
|
|
||||||
local state = require 'which-key.state'
|
local state = require 'which-key.state'
|
||||||
local orig_getchar = state.getchar
|
local orig_getchar = state.getchar
|
||||||
state.getchar = function()
|
state.getchar = function()
|
||||||
local ok, char = orig_getchar()
|
local ok, char = orig_getchar()
|
||||||
if ok and char == ' ' then
|
if ok and char == ' ' and state.state and state.state.show then
|
||||||
char = vim.api.nvim_replace_termcodes('<Esc>', true, false, true)
|
char = vim.api.nvim_replace_termcodes('<Esc>', true, false, true)
|
||||||
end
|
end
|
||||||
return ok, char
|
return ok, char
|
||||||
|
|||||||
Reference in New Issue
Block a user