fix tab/s-tab with snippets
This commit is contained in:
@@ -77,7 +77,11 @@ NV_Darcula_Coc_Shift_Tab_Complete = function()
|
||||
return vim.fn["coc#pum#prev"](1)
|
||||
end
|
||||
|
||||
return "<C-h>"
|
||||
if vim.fn["coc#jumpable"](-1) == 1 then
|
||||
return vim.fn["coc#rpc#request"]("doKeymap", {"snippets-previous"})
|
||||
end
|
||||
|
||||
return "<S-Tab>"
|
||||
end
|
||||
|
||||
NV_Darcula_Coc_Tab_Complete = function()
|
||||
@@ -85,15 +89,17 @@ NV_Darcula_Coc_Tab_Complete = function()
|
||||
return vim.fn["coc#pum#next"](1)
|
||||
end
|
||||
|
||||
if vim.fn["coc#expandableOrJumpable"]() == 1 then
|
||||
return vim.fn["coc#rpc#request"]("doKeymap", {"snippets-expand-jump"})
|
||||
end
|
||||
|
||||
local check_backspace = function()
|
||||
local col = vim.api.nvim_win_get_cursor(0)[2]
|
||||
return (col == 0 or
|
||||
vim.api.nvim_get_current_line():sub(col, col):match("%s")) and
|
||||
true
|
||||
return col == 0 or vim.api.nvim_get_current_line():sub(col, col):match("%s")
|
||||
end
|
||||
|
||||
if check_backspace() then
|
||||
return "<tab>"
|
||||
return "<Tab>"
|
||||
end
|
||||
|
||||
return vim.fn["coc#refresh"]()
|
||||
|
||||
Reference in New Issue
Block a user