Skip to content

Commit 3ce69f3

Browse files
committed
fix empty query
1 parent 4b54f57 commit 3ce69f3

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lua/dired/init.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,10 +1132,18 @@ Browser.State = {
11321132
query = query:gsub('^' .. SEPARATOR, '')
11331133

11341134
-- Empty query or directory navigation
1135-
if query == '' or query:match(SEPARATOR .. '$') then
1135+
if query == '' then
11361136
Actions.openDirectory(state, state.current_path).run()
11371137
return
11381138
end
1139+
1140+
if query:match(SEPARATOR .. '$') then
1141+
local full_path = vim.fs.joinpath(state.current_path, query)
1142+
if PathOps.isDirectory(full_path) then
1143+
Actions.openDirectory(state, full_path).run()
1144+
end
1145+
return
1146+
end
11391147
state.entries = {}
11401148
state.search_engine.search(state, query, function(entries, count, maxwidth)
11411149
state.entries = vim.list_extend(state.entries, entries)

0 commit comments

Comments
 (0)