Skip to content

Commit d7d295c

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

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

filemanager-plugin/filemanager.lua

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -958,11 +958,9 @@ 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
961+
if micro.CurPane() == tree_view then
962+
try_open_at_y(tree_view.Cursor.Loc.Y)
963963
end
964-
965-
try_open_at_y(tree_view.Cursor.Loc.Y)
966964
end
967965

968966
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1089,7 +1087,7 @@ function onMousePress(view)
10891087
if view == tree_view then
10901088
-- Try to open whatever is at the click's y index
10911089
-- Will go into/back dirs based on what's clicked, nothing gets expanded
1092-
try_open_at_y(tree_view.Cursor.Loc.Y)
1090+
try_open_at_cursor()
10931091
-- Don't actually allow the mousepress to trigger, so we avoid highlighting stuff
10941092
return false
10951093
end
@@ -1136,7 +1134,7 @@ function preIndentSelection(view)
11361134
tab_pressed = true
11371135
-- Open the file
11381136
-- Using tab instead of enter, since enter won't work with Readonly
1139-
try_open_at_y(tree_view.Cursor.Loc.Y)
1137+
try_open_at_cursor()
11401138
-- Don't actually insert a tab
11411139
return false
11421140
end

0 commit comments

Comments
 (0)