nvim-config

Log | Files | Refs | Submodules | README

commit 2fd3cca50d51340fd617bc10eb80b93fa1e22791
parent 073cd1526b048cb9b1076ba460c1df6484ab194f
Author: Thomas Vigouroux <thomas.vigouroux@protonmail.com>
Date:   Wed, 22 Jun 2022 10:40:30 +0200

feat: enhance tab completion

Diffstat:
Mlua/mappings.lua | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lua/mappings.lua b/lua/mappings.lua @@ -15,7 +15,7 @@ end local function sjump() vim.schedule(function () - if luasnip.jumpable(1) then + if luasnip.jumpable(1) and luasnip.in_snippet() then luasnip.jump(1) end end) @@ -24,7 +24,7 @@ end function tab_complete() if vim.fn.pumvisible() == 1 then return feed '<C-N>' - elseif vim.api.nvim_get_current_line():match("^%s*$") then + elseif vim.api.nvim_get_current_line():sub(1, vim.fn.getcurpos()[3] - 1):match("^%s*$") then return feed '<Tab>' end