diff --git a/.luarc.json b/.luarc.json index 0c49a3b..b438cce 100644 --- a/.luarc.json +++ b/.luarc.json @@ -2,12 +2,6 @@ "runtime.version": "Lua 5.1", "runtime.path": ["lua/?.lua", "lua/?/init.lua"], "diagnostics.globals": ["vim", "jit"], - "diagnostics.disable": [ - "undefined-doc-name", - "undefined-doc-class", - "undefined-field", - "need-check-nil" - ], "workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"], "workspace.checkThirdParty": false, "completion.callSnippet": "Replace" diff --git a/lua/blink-cmp-tmux.lua b/lua/blink-cmp-tmux.lua index 1653c06..b92a6e6 100644 --- a/lua/blink-cmp-tmux.lua +++ b/lua/blink-cmp-tmux.lua @@ -47,7 +47,7 @@ local function parse_descriptions(man_stdout, names_stdout) local j = def.line + 1 while j <= block_end do local l = lines[j] - if l:match('^%s+%(alias:') or vim.trim(l) == '' then + if l:match('^%s+%(alias:') then j = j + 1 elseif l:match('^ ') then local stripped = vim.trim(l) @@ -56,6 +56,8 @@ local function parse_descriptions(man_stdout, names_stdout) else break end + elseif vim.trim(l) == '' then + j = j + 1 else break end @@ -84,7 +86,7 @@ local function parse_descriptions(man_stdout, names_stdout) end end local desc = table.concat(parts, '\n\n') - desc = desc:gsub(string.char(0xe2, 0x80, 0x90) .. ' ', '') + desc = desc:gsub('\xe2\x80\x90 ', '') desc = desc:gsub(' +', ' ') if desc ~= '' then descs[def.cmd] = desc diff --git a/lua/blink-cmp-tmux/health.lua b/lua/blink-cmp-tmux/health.lua deleted file mode 100644 index 86839e3..0000000 --- a/lua/blink-cmp-tmux/health.lua +++ /dev/null @@ -1,36 +0,0 @@ -local M = {} - -function M.check() - vim.health.start('blink-cmp-tmux') - - local ok = pcall(require, 'blink.cmp') - if ok then - vim.health.ok('blink.cmp is installed') - else - vim.health.error('blink.cmp is not installed') - end - - local bin = vim.fn.exepath('tmux') - if bin ~= '' then - vim.health.ok('tmux executable found: ' .. bin) - else - vim.health.error('tmux executable not found') - return - end - - local result = vim.system({ 'tmux', 'list-commands' }):wait() - if result.code == 0 and result.stdout and result.stdout ~= '' then - vim.health.ok('tmux list-commands produces output') - else - vim.health.warn('tmux list-commands failed (completions will be unavailable)') - end - - local man_bin = vim.fn.exepath('man') - if man_bin ~= '' then - vim.health.ok('man executable found: ' .. man_bin) - else - vim.health.warn('man executable not found (command descriptions will be unavailable)') - end -end - -return M diff --git a/spec/tmux_spec.lua b/spec/tmux_spec.lua index da0c32e..e584a5a 100644 --- a/spec/tmux_spec.lua +++ b/spec/tmux_spec.lua @@ -46,11 +46,7 @@ local function mock_system() on_exit(result) return {} end - return { - wait = function() - return result - end, - } + return { wait = function() return result end } end vim.schedule = function(fn) fn()