We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 36d0174 commit 089d0e4Copy full SHA for 089d0e4
lua/yazi/keybinding_helpers.lua
@@ -214,8 +214,10 @@ end
214
215
---@param context YaziActiveContext
216
function YaziOpenerActions.change_working_directory(context)
217
+ local path = context.input_path
218
local last_directory = context.ya_process.cwd
- if last_directory then
219
+ or (path and path:parent().filename)
220
+ if last_directory and last_directory ~= vim.fn.getcwd() then
221
vim.notify('cwd changed to "' .. last_directory .. '"')
222
vim.cmd({ cmd = "cd", args = { last_directory } })
223
end
0 commit comments