Fix for when folder.window is nil
This commit is contained in:
6
init.lua
6
init.lua
@@ -35,7 +35,11 @@ end)
|
|||||||
|
|
||||||
local _get_hovered_file = ya.sync(function()
|
local _get_hovered_file = ya.sync(function()
|
||||||
local folder = Folder:by_kind(Folder.CURRENT)
|
local folder = Folder:by_kind(Folder.CURRENT)
|
||||||
return folder.window[folder.cursor - folder.offset + 1].url
|
local file_hovered = folder.window[folder.cursor - folder.offset + 1]
|
||||||
|
if not file_hovered then
|
||||||
|
return folder.cwd
|
||||||
|
end
|
||||||
|
return file_hovered.url
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local _load_state = ya.sync(function(state)
|
local _load_state = ya.sync(function(state)
|
||||||
|
|||||||
Reference in New Issue
Block a user