Skip to content

Commit d804fb3

Browse files
committed
WIP
1 parent d833955 commit d804fb3

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

lua/neo-tree/command/parser.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ local M = {
88
}
99

1010
M.setup = function (all_source_names)
11-
print("all_source_names", vim.inspect(all_source_names))
1211
local source_names = utils.table_copy(all_source_names)
1312
table.insert(source_names, "migrations")
1413

@@ -156,6 +155,7 @@ local parse_arg = function(result, arg)
156155
end
157156

158157
M.parse = function(args, strict_checking)
158+
require("neo-tree").ensure_config()
159159
local result = {}
160160

161161
if type(args) == "string" then

lua/neo-tree/sources/manager.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ end
410410
---@param callback function Callback to call after the items are loaded.
411411
---@param async boolean Whether to load the items asynchronously, may not be respected by all sources.
412412
M.navigate = function(state_or_source_name, path, path_to_reveal, callback, async)
413+
require("neo-tree").ensure_config()
413414
local state, source_name
414415
if type(state_or_source_name) == "string" then
415416
state = M.get_state(state_or_source_name)
@@ -421,7 +422,11 @@ M.navigate = function(state_or_source_name, path, path_to_reveal, callback, asyn
421422
log.error("navigate: state_or_source_name must be a string or a table")
422423
end
423424
log.trace("navigate", source_name, path, path_to_reveal)
424-
get_source_data(source_name).module.navigate(state, path, path_to_reveal, callback, async)
425+
local mod = get_source_data(source_name).module
426+
if not mod then
427+
mod = require("neo-tree.sources." .. source_name)
428+
end
429+
mod.navigate(state, path, path_to_reveal, callback, async)
425430
end
426431

427432
---Redraws the tree without scanning the filesystem again. Use this after

0 commit comments

Comments
 (0)