Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions clink/lua/clink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -406,3 +406,19 @@ function clink.filter_prompt(prompt)
end

-- vim: expandtab

-- from here: https://github.com/cmderdev/cmder/issues/1051#issuecomment-242201036
local function tilde_match (text, f, l)
if text == '~' then
clink.add_match(clink.get_env('userprofile'))
clink.matches_are_files()
return true
end
if text:sub(1, 1) == '~' then
clink.add_match(string.gsub(text, "~", clink.get_env('userprofile'), 1))
clink.suppress_char_append()
clink.matches_are_files()
return true
end
end
clink.register_match_generator(tilde_match, 1)