mirror of
https://github.com/folke/snacks.nvim
synced 2025-12-23 08:47:57 +00:00
fix(picker.actions): <c-g> in list view now prints file path instead of cwd. Fallback to cwd
This commit is contained in:
parent
58448e02f5
commit
0b0a58ae4a
2 changed files with 11 additions and 2 deletions
|
|
@ -154,7 +154,16 @@ function M.close(picker)
|
|||
end
|
||||
|
||||
function M.print_cwd(picker)
|
||||
print(picker:cwd())
|
||||
print(vim.fn.fnamemodify(picker:cwd(), ":p:~"))
|
||||
end
|
||||
|
||||
function M.print_dir(picker)
|
||||
print(vim.fn.fnamemodify(picker:dir(), ":p:~"))
|
||||
end
|
||||
|
||||
function M.print_path(picker, item)
|
||||
local path = item and Snacks.picker.util.path(item) or picker:dir()
|
||||
print(vim.fn.fnamemodify(path, ":p:~"))
|
||||
end
|
||||
|
||||
function M.cancel(picker)
|
||||
|
|
|
|||
|
|
@ -291,7 +291,7 @@ local defaults = {
|
|||
["<c-n>"] = "list_down",
|
||||
["<c-p>"] = "list_up",
|
||||
["<c-q>"] = "qflist",
|
||||
["<c-g>"] = "print_cwd",
|
||||
["<c-g>"] = "print_path",
|
||||
["<c-s>"] = "edit_split",
|
||||
["<c-t>"] = "tab",
|
||||
["<c-u>"] = "list_scroll_up",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue