Skip to content

Commit 72a5908

Browse files
committed
fix(cmdline): set label for ~ to expanded home path
When the completion candidate is `~`, display expanded home directory (`/home/user/`) as the label instead of only showing the basename (`user/`).
1 parent 4ae97d1 commit 72a5908

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lua/blink/cmp/sources/cmdline/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ function cmdline:get_completions(context, callback)
195195

196196
-- path completion in commands, e.g. `chdir <path>` and options, e.g. `:set directory=<path>`
197197
elseif is_path_completion then
198+
if current_arg == '~' then label = completion end
198199
filter_text = path_lib.basename_with_sep(completion)
199200
new_text = vim.fn.fnameescape(completion)
200201
if arguments[1] == 'set' then

0 commit comments

Comments
 (0)