fix(nvim): correctly insert raw tab for tab switch binding

This commit is contained in:
Price Hiller 2023-10-17 16:24:50 -05:00
parent e4b097773e
commit 5212f84c90
Signed by: Price
SSH Key Fingerprint: SHA256:Y4S9ZzYphRn1W1kbJerJFO6GGsfu9O70VaBSxJO7dF8

View File

@ -96,7 +96,7 @@ M.setup = function()
-- Binding to insert literal tab
vim.keymap.set("i", "<S-Tab>", function()
if vim.opt_local.expandtab:get() then
vim.api.nvim_feedkeys("\t", "m", false)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes("<C-V><TAB>", true, false, true), "m", true)
else
local spaces = string.rep(" ", vim.opt_local.shiftwidth:get() or 4)
vim.api.nvim_feedkeys(spaces, "m", false)