diff --git a/lua/options.lua b/lua/options.lua index 57456b7..d053a69 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -7,7 +7,6 @@ G.opt.rnu = true G.opt.scrolloff = 999 -- 自动保存 -G.opt.autowrite = true G.opt.autowriteall = true -- tab键 diff --git a/lua/plugs/nvim-cmp.lua b/lua/plugs/nvim-cmp.lua index 49076ad..191a2e9 100644 --- a/lua/plugs/nvim-cmp.lua +++ b/lua/plugs/nvim-cmp.lua @@ -18,8 +18,8 @@ return { }, config = function() local has_words_before = function() - local unpack = table.unpack - local line, col = unpack(G.api.nvim_win_get_cursor(0)) + local cursor = G.api.nvim_win_get_cursor(0) + local line, col = cursor[1], cursor[2] return col ~= 0 and G.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match('%s') == nil end