Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions filemanager-plugin/filemanager.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = "3.5.1"
VERSION = "3.5.2"

local micro = import("micro")
local config = import("micro/config")
Expand Down Expand Up @@ -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

-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down