Skip to content

Commit 6e187c1

Browse files
committed
Use function try_open_at_cursor for Tab and mouse click action
1 parent fd42ee3 commit 6e187c1

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

filemanager-plugin/filemanager.lua

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,10 +958,6 @@ function goto_parent_dir()
958958
end
959959

960960
function try_open_at_cursor()
961-
if micro.CurPane() ~= tree_view or scanlist_is_empty() then
962-
return
963-
end
964-
965961
try_open_at_y(tree_view.Cursor.Loc.Y)
966962
end
967963

@@ -1089,7 +1085,7 @@ function onMousePress(view)
10891085
if view == tree_view then
10901086
-- Try to open whatever is at the click's y index
10911087
-- Will go into/back dirs based on what's clicked, nothing gets expanded
1092-
try_open_at_y(tree_view.Cursor.Loc.Y)
1088+
try_open_at_cursor()
10931089
-- Don't actually allow the mousepress to trigger, so we avoid highlighting stuff
10941090
return false
10951091
end
@@ -1136,7 +1132,7 @@ function preIndentSelection(view)
11361132
tab_pressed = true
11371133
-- Open the file
11381134
-- Using tab instead of enter, since enter won't work with Readonly
1139-
try_open_at_y(tree_view.Cursor.Loc.Y)
1135+
try_open_at_cursor()
11401136
-- Don't actually insert a tab
11411137
return false
11421138
end

0 commit comments

Comments
 (0)