Skip to content

Commit

Permalink
update name
Browse files Browse the repository at this point in the history
  • Loading branch information
pynappo committed Jan 26, 2025
1 parent 7e3a67a commit 43eba83
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ use {
enable_git_status = true,
enable_diagnostics = true,
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
open_files_using_relative_paths = false,
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil , -- use a custom function for sorting files and directories in the tree
-- sort_function = function (a,b)
Expand Down
2 changes: 1 addition & 1 deletion lua/neo-tree/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ local config = {
log_to_file = false, -- true, false, "/path/to/file.log", use :NeoTreeLogs to show the file
open_files_in_last_window = true, -- false = open files in top left window
open_files_do_not_replace_types = { "terminal", "Trouble", "qf", "edgy" }, -- when opening files, do not use windows containing these filetypes or buftypes
open_file_with_relative = false, -- true = open file with relative path
open_files_using_relative_paths = false,
-- popup_border_style is for input and confirmation dialogs.
-- Configurtaion of floating window is done in the individual source sections.
-- "NC" is a special style that works well with NormalNC set
Expand Down
2 changes: 1 addition & 1 deletion lua/neo-tree/sources/common/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ local open_with_cmd = function(state, open_cmd, toggle_directory, open_file)
if type(open_file) == "function" then
open_file(state, path, open_cmd, bufnr)
else
utils.open_file(state, path, open_cmd, bufnr, require('neo-tree').config.open_file_with_relative)
utils.open_file(state, path, open_cmd, bufnr)
end
local extra = node.extra or {}
local pos = extra.position or extra.end_position
Expand Down
5 changes: 3 additions & 2 deletions lua/neo-tree/utils/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ end
---@param path string The file to open
---@param open_cmd string? The vimcommand to use to open the file
---@param bufnr number|nil The buffer number to open
M.open_file = function(state, path, open_cmd, bufnr, relative)
M.open_file = function(state, path, open_cmd, bufnr)
open_cmd = open_cmd or "edit"
-- If the file is already open, switch to it.
bufnr = bufnr or M.find_buffer_by_name(path)
Expand All @@ -707,7 +707,8 @@ M.open_file = function(state, path, open_cmd, bufnr, relative)
end

if M.truthy(path) then
local escaped_path = M.escape_path_for_cmd(relative and vim.fn.fnamemodify(path, ':.') or path)
local relative = require("neo-tree").config.open_files_using_relative_paths
local escaped_path = M.escape_path_for_cmd(relative and vim.fn.fnamemodify(path, ":.") or path)
local bufnr_or_path = bufnr or escaped_path
local events = require("neo-tree.events")
local result = true
Expand Down

0 comments on commit 43eba83

Please sign in to comment.