diff --git a/filemanager-plugin/filemanager.lua b/filemanager-plugin/filemanager.lua index fef17d4..5bc0ea7 100644 --- a/filemanager-plugin/filemanager.lua +++ b/filemanager-plugin/filemanager.lua @@ -1,4 +1,4 @@ -VERSION = "3.5.1" +VERSION = "3.5.2" local micro = import("micro") local config = import("micro/config") @@ -958,11 +958,9 @@ function goto_parent_dir() end function try_open_at_cursor() - if micro.CurPane() ~= tree_view or scanlist_is_empty() then - return + if micro.CurPane() == tree_view then + try_open_at_y(tree_view.Cursor.Loc.Y) end - - try_open_at_y(tree_view.Cursor.Loc.Y) end -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1085,14 +1083,11 @@ function onPreviousSplit(view) end -- On click, open at the click's y -function preMousePress(view, event) +function onMousePress(view) if view == tree_view then - local x, y = event:Position() - -- Fixes the y because softwrap messes with it - local new_x, new_y = tree_view:GetMouseClickLocation(x, y) -- Try to open whatever is at the click's y index -- Will go into/back dirs based on what's clicked, nothing gets expanded - try_open_at_y(new_y) + try_open_at_cursor() -- Don't actually allow the mousepress to trigger, so we avoid highlighting stuff return false end @@ -1139,7 +1134,7 @@ function preIndentSelection(view) tab_pressed = true -- Open the file -- Using tab instead of enter, since enter won't work with Readonly - try_open_at_y(tree_view.Cursor.Loc.Y) + try_open_at_cursor() -- Don't actually insert a tab return false end