From bc435e499eaf9d5c5f971d6aba49beebbf1307bf Mon Sep 17 00:00:00 2001 From: newbieQQ Date: Thu, 11 Jun 2026 15:28:19 +0800 Subject: [PATCH] fix: replace table.unpack with direct indexing for Neovim 0.12 compat --- lua/options.lua | 1 - lua/plugs/nvim-cmp.lua | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) 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