Skip to content

Commit fea7674

Browse files
committed
refactor: abbreviate custom function description
- Update comment for clarity - Abbreviate '<Custom Function>' to '<Custom Fn>' to save UI space
1 parent 2695c04 commit fea7674

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lua/blink/cmp/keymap/apply.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,19 @@ local function get_desc(commands)
1414
-- Filter out "fallback" & "fallback_to_mappings"
1515
if cmd ~= 'fallback' and cmd ~= 'fallback_to_mappings' then
1616
if type(cmd) == 'string' then
17-
-- Substitute all '_' with space, then captilize separated token
17+
-- Seperate on '_', then captilize each token
1818
local readable_cmd = cmd:gsub('_', ' ')
1919
readable_cmd = readable_cmd:gsub('(%a)(%w*)', function(first, rest) return first:upper() .. rest end)
2020
table.insert(parts, readable_cmd)
2121
elseif type(cmd) == 'function' then
22-
table.insert(parts, '<Custom Function>')
22+
table.insert(parts, '<Custom Fn>')
2323
end
2424
end
2525
end
2626

2727
-- In case the list consisted of only fallbacks
2828
if #parts == 0 then return prefix .. 'Default Behavior' end
29+
2930
return prefix .. table.concat(parts, ', ')
3031
end
3132

0 commit comments

Comments
 (0)