Fix #734
This commit is contained in:
@@ -318,7 +318,7 @@ core.confirm = function(self, e, option, callback)
|
|||||||
-- Close menus.
|
-- Close menus.
|
||||||
self.view:close()
|
self.view:close()
|
||||||
|
|
||||||
feedkeys.call(keymap.t('<Cmd>set indentkeys=<CR>'), 'n')
|
feedkeys.call(keymap.indentkeys(), 'n')
|
||||||
feedkeys.call('', 'n', function()
|
feedkeys.call('', 'n', function()
|
||||||
local ctx = context.new()
|
local ctx = context.new()
|
||||||
local keys = {}
|
local keys = {}
|
||||||
@@ -424,7 +424,7 @@ core.confirm = function(self, e, option, callback)
|
|||||||
feedkeys.call(table.concat(keys, ''), 'int')
|
feedkeys.call(table.concat(keys, ''), 'int')
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
feedkeys.call(keymap.t('<Cmd>set indentkeys=%s<CR>'):format(vim.fn.escape(vim.bo.indentkeys, ' "|\\')), 'n')
|
feedkeys.call(keymap.indentkeys(vim.bo.indentkeys), 'n')
|
||||||
feedkeys.call('', 'n', function()
|
feedkeys.call('', 'n', function()
|
||||||
e:execute(vim.schedule_wrap(function()
|
e:execute(vim.schedule_wrap(function()
|
||||||
release()
|
release()
|
||||||
|
|||||||
@@ -75,6 +75,13 @@ keymap.backspace = function(count)
|
|||||||
return table.concat(keys, '')
|
return table.concat(keys, '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---Update indentkeys.
|
||||||
|
---@param expr string
|
||||||
|
---@return string
|
||||||
|
keymap.indentkeys = function(expr)
|
||||||
|
return string.format(keymap.t('<Cmd>set indentkeys=%s<CR>'), expr and vim.fn.escape(expr, '| \t\\') or '')
|
||||||
|
end
|
||||||
|
|
||||||
---Return two key sequence are equal or not.
|
---Return two key sequence are equal or not.
|
||||||
---@param a string
|
---@param a string
|
||||||
---@param b string
|
---@param b string
|
||||||
|
|||||||
@@ -314,10 +314,10 @@ custom_entries_view._insert = setmetatable({
|
|||||||
local cursor = api.get_cursor()
|
local cursor = api.get_cursor()
|
||||||
local length = vim.fn.strchars(string.sub(api.get_current_line(), self.offset, cursor[2]), true)
|
local length = vim.fn.strchars(string.sub(api.get_current_line(), self.offset, cursor[2]), true)
|
||||||
local keys = {}
|
local keys = {}
|
||||||
table.insert(keys, keymap.t('<Cmd>set indentkeys=<CR>'))
|
table.insert(keys, keymap.indentkeys())
|
||||||
table.insert(keys, keymap.backspace(length))
|
table.insert(keys, keymap.backspace(length))
|
||||||
table.insert(keys, word)
|
table.insert(keys, word)
|
||||||
table.insert(keys, keymap.t('<Cmd>set indentkeys=%s<CR>'):format(vim.fn.escape(vim.bo.indentkeys, ' "|\\')))
|
table.insert(keys, keymap.indentkeys(vim.bo.indentkeys))
|
||||||
feedkeys.call(
|
feedkeys.call(
|
||||||
table.concat(keys, ''),
|
table.concat(keys, ''),
|
||||||
'int',
|
'int',
|
||||||
|
|||||||
Reference in New Issue
Block a user