From a145b2648a054c8b09753bc2c97e3af08ee7d03c Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sun, 22 Feb 2026 23:37:06 -0500 Subject: [PATCH] fix: tighten keyword detection to avoid preamble false positives Problem: the 2-space inline keyword pattern matched preamble lines like "The possible keywords" where "The" was detected as a keyword. Solution: require an uppercase letter after the 2 spaces, matching real inline definitions (Tunnel Request, SetEnv Directly) but not preamble text where the next word is lowercase. --- lua/blink-cmp-ssh.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lua/blink-cmp-ssh.lua b/lua/blink-cmp-ssh.lua index 8b8a6cf..98078c8 100644 --- a/lua/blink-cmp-ssh.lua +++ b/lua/blink-cmp-ssh.lua @@ -52,7 +52,9 @@ local function extract_enums_from_man(man_stdout) local defs = {} for i, line in ipairs(lines) do - local kw = line:match('^ (%u[%a%d]+)%s*$') or line:match('^ (%u[%a%d]+) ') + local kw = line:match('^ (%u[%a%d]+)%s*$') + or line:match('^ (%u[%a%d]+) ') + or line:match('^ (%u[%a%d]+) %u') if kw then defs[#defs + 1] = { line = i, keyword = kw } end @@ -163,7 +165,9 @@ local function parse_keywords(stdout) local defs = {} for i, line in ipairs(lines) do - local kw = line:match('^ (%u[%a%d]+)%s*$') or line:match('^ (%u[%a%d]+) ') + local kw = line:match('^ (%u[%a%d]+)%s*$') + or line:match('^ (%u[%a%d]+) ') + or line:match('^ (%u[%a%d]+) %u') if kw then local inline = line:match('^ %u[%a%d]+%s%s+(.+)') defs[#defs + 1] = { line = i, keyword = kw, inline = inline }