chore: stylua column width 120 -> 140
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
column_width = 120
|
column_width = 140
|
||||||
line_endings = "Unix"
|
line_endings = "Unix"
|
||||||
indent_type = "Spaces"
|
indent_type = "Spaces"
|
||||||
indent_width = 2
|
indent_width = 2
|
||||||
|
|||||||
@@ -218,10 +218,7 @@ local function setup_autocommands(opts)
|
|||||||
create_nvim_tree_autocmd("BufReadPost", {
|
create_nvim_tree_autocmd("BufReadPost", {
|
||||||
callback = function(data)
|
callback = function(data)
|
||||||
-- update opened file buffers
|
-- update opened file buffers
|
||||||
if
|
if (filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none") and vim.bo[data.buf].buftype == "" then
|
||||||
(filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none")
|
|
||||||
and vim.bo[data.buf].buftype == ""
|
|
||||||
then
|
|
||||||
utils.debounce("Buf:filter_buffer", opts.view.debounce_delay, function()
|
utils.debounce("Buf:filter_buffer", opts.view.debounce_delay, function()
|
||||||
reloaders.reload_explorer()
|
reloaders.reload_explorer()
|
||||||
end)
|
end)
|
||||||
@@ -232,10 +229,7 @@ local function setup_autocommands(opts)
|
|||||||
create_nvim_tree_autocmd("BufUnload", {
|
create_nvim_tree_autocmd("BufUnload", {
|
||||||
callback = function(data)
|
callback = function(data)
|
||||||
-- update opened file buffers
|
-- update opened file buffers
|
||||||
if
|
if (filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none") and vim.bo[data.buf].buftype == "" then
|
||||||
(filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none")
|
|
||||||
and vim.bo[data.buf].buftype == ""
|
|
||||||
then
|
|
||||||
utils.debounce("Buf:filter_buffer", opts.view.debounce_delay, function()
|
utils.debounce("Buf:filter_buffer", opts.view.debounce_delay, function()
|
||||||
reloaders.reload_explorer(nil, data.buf)
|
reloaders.reload_explorer(nil, data.buf)
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -52,9 +52,7 @@ function M.fn(default_modifier)
|
|||||||
|
|
||||||
-- support for only specific modifiers have been implemented
|
-- support for only specific modifiers have been implemented
|
||||||
if not ALLOWED_MODIFIERS[modifier] then
|
if not ALLOWED_MODIFIERS[modifier] then
|
||||||
return notify.warn(
|
return notify.warn("Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ","))
|
||||||
"Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ",")
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
node = lib.get_last_group_node(node)
|
node = lib.get_last_group_node(node)
|
||||||
|
|||||||
@@ -47,8 +47,7 @@ local function gen_iterator()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
:recursor(function(node)
|
:recursor(function(node)
|
||||||
return expansion_count < M.MAX_FOLDER_DISCOVERY
|
return expansion_count < M.MAX_FOLDER_DISCOVERY and (node.group_next and { node.group_next } or (node.open and node.nodes))
|
||||||
and (node.group_next and { node.group_next } or (node.open and node.nodes))
|
|
||||||
end)
|
end)
|
||||||
:iterate()
|
:iterate()
|
||||||
|
|
||||||
|
|||||||
@@ -30,11 +30,7 @@ local function populate_children(handle, cwd, node, git_status)
|
|||||||
local profile = log.profile_start("explore populate_children %s", abs)
|
local profile = log.profile_start("explore populate_children %s", abs)
|
||||||
|
|
||||||
t = get_type_from(t, abs)
|
t = get_type_from(t, abs)
|
||||||
if
|
if not filters.should_filter(abs, filter_status) and not nodes_by_path[abs] and Watcher.is_fs_event_capable(abs) then
|
||||||
not filters.should_filter(abs, filter_status)
|
|
||||||
and not nodes_by_path[abs]
|
|
||||||
and Watcher.is_fs_event_capable(abs)
|
|
||||||
then
|
|
||||||
local child = nil
|
local child = nil
|
||||||
if t == "directory" and vim.loop.fs_access(abs, "R") then
|
if t == "directory" and vim.loop.fs_access(abs, "R") then
|
||||||
child = builders.folder(node, abs, name)
|
child = builders.folder(node, abs, name)
|
||||||
|
|||||||
@@ -121,10 +121,7 @@ function M.should_filter(path, status)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
return git(path, status.git_status)
|
return git(path, status.git_status) or buf(path, status.bufinfo, status.unloaded_bufnr) or dotfile(path) or custom(path)
|
||||||
or buf(path, status.bufinfo, status.unloaded_bufnr)
|
|
||||||
or dotfile(path)
|
|
||||||
or custom(path)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function M.setup(opts)
|
function M.setup(opts)
|
||||||
|
|||||||
@@ -109,8 +109,7 @@ local function compute()
|
|||||||
|
|
||||||
-- header, not padded
|
-- header, not padded
|
||||||
local hl = { { "NvimTreeRootFolder", 0, 0, #head_lhs } }
|
local hl = { { "NvimTreeRootFolder", 0, 0, #head_lhs } }
|
||||||
local lines =
|
local lines = { ("%s%s%s"):format(head_lhs, string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs + 2), head_rhs) }
|
||||||
{ ("%s%s%s"):format(head_lhs, string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs + 2), head_rhs) }
|
|
||||||
local width = #lines[1]
|
local width = #lines[1]
|
||||||
|
|
||||||
-- mappings, left padded 1
|
-- mappings, left padded 1
|
||||||
@@ -177,12 +176,7 @@ local function open()
|
|||||||
vim.wo[M.winnr].cursorline = M.config.cursorline
|
vim.wo[M.winnr].cursorline = M.config.cursorline
|
||||||
|
|
||||||
-- quit binding
|
-- quit binding
|
||||||
vim.keymap.set(
|
vim.keymap.set("n", "q", close, { desc = "nvim-tree: exit help", buffer = M.bufnr, noremap = true, silent = true, nowait = true })
|
||||||
"n",
|
|
||||||
"q",
|
|
||||||
close,
|
|
||||||
{ desc = "nvim-tree: exit help", buffer = M.bufnr, noremap = true, silent = true, nowait = true }
|
|
||||||
)
|
|
||||||
|
|
||||||
-- close window and delete buffer on leave
|
-- close window and delete buffer on leave
|
||||||
vim.api.nvim_create_autocmd({ "BufLeave", "WinLeave" }, {
|
vim.api.nvim_create_autocmd({ "BufLeave", "WinLeave" }, {
|
||||||
|
|||||||
@@ -40,15 +40,7 @@ local function refactored(opts)
|
|||||||
utils.move_missing_val(opts, "git", "ignore", opts, "filters", "git_ignored", true)
|
utils.move_missing_val(opts, "git", "ignore", opts, "filters", "git_ignored", true)
|
||||||
|
|
||||||
-- 2023/08/26
|
-- 2023/08/26
|
||||||
utils.move_missing_val(
|
utils.move_missing_val(opts, "renderer.icons", "webdev_colors", opts, "renderer.icons.web_devicons.file", "color", true)
|
||||||
opts,
|
|
||||||
"renderer.icons",
|
|
||||||
"webdev_colors",
|
|
||||||
opts,
|
|
||||||
"renderer.icons.web_devicons.file",
|
|
||||||
"color",
|
|
||||||
true
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local function deprecated(opts)
|
local function deprecated(opts)
|
||||||
|
|||||||
@@ -7,15 +7,12 @@ local config = {
|
|||||||
|
|
||||||
local title_support
|
local title_support
|
||||||
function M.supports_title()
|
function M.supports_title()
|
||||||
-- TODO increase stylua column_width
|
|
||||||
-- stylua: ignore start
|
|
||||||
if title_support == nil then
|
if title_support == nil then
|
||||||
title_support = (package.loaded.notify and (vim.notify == require "notify" or vim.notify == require("notify").notify))
|
title_support = (package.loaded.notify and (vim.notify == require "notify" or vim.notify == require("notify").notify))
|
||||||
or (package.loaded.noice and (vim.notify == require("noice").notify or vim.notify == require("noice.source.notify").notify))
|
or (package.loaded.noice and (vim.notify == require("noice").notify or vim.notify == require("noice.source.notify").notify))
|
||||||
or (package.loaded.notifier and require("notifier.config").has_component "nvim")
|
or (package.loaded.notifier and require("notifier.config").has_component "nvim")
|
||||||
or false
|
or false
|
||||||
end
|
end
|
||||||
-- stylua: ignore end
|
|
||||||
|
|
||||||
return title_support
|
return title_support
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -168,9 +168,7 @@ function Builder:_build_folder(node)
|
|||||||
local link_to = utils.path_relative(node.link_to, core.get_cwd())
|
local link_to = utils.path_relative(node.link_to, core.get_cwd())
|
||||||
foldername = foldername .. arrow .. link_to
|
foldername = foldername .. arrow .. link_to
|
||||||
foldername_hl = "NvimTreeSymlinkFolderName"
|
foldername_hl = "NvimTreeSymlinkFolderName"
|
||||||
elseif
|
elseif vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name) then
|
||||||
vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name)
|
|
||||||
then
|
|
||||||
foldername_hl = "NvimTreeSpecialFolderName"
|
foldername_hl = "NvimTreeSpecialFolderName"
|
||||||
elseif node.open then
|
elseif node.open then
|
||||||
foldername_hl = "NvimTreeOpenedFolderName"
|
foldername_hl = "NvimTreeOpenedFolderName"
|
||||||
@@ -278,11 +276,7 @@ function Builder:_get_highlight_override(node, unloaded_bufnr)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- opened file
|
-- opened file
|
||||||
if
|
if self.highlight_opened_files and vim.fn.bufloaded(node.absolute_path) > 0 and vim.fn.bufnr(node.absolute_path) ~= unloaded_bufnr then
|
||||||
self.highlight_opened_files
|
|
||||||
and vim.fn.bufloaded(node.absolute_path) > 0
|
|
||||||
and vim.fn.bufnr(node.absolute_path) ~= unloaded_bufnr
|
|
||||||
then
|
|
||||||
if self.highlight_opened_files == "all" or self.highlight_opened_files == "name" then
|
if self.highlight_opened_files == "all" or self.highlight_opened_files == "name" then
|
||||||
name_hl = "NvimTreeOpenedFile"
|
name_hl = "NvimTreeOpenedFile"
|
||||||
end
|
end
|
||||||
@@ -331,16 +325,7 @@ end
|
|||||||
---@param modified_icon HighlightedString|nil
|
---@param modified_icon HighlightedString|nil
|
||||||
---@param bookmark_icon HighlightedString|nil
|
---@param bookmark_icon HighlightedString|nil
|
||||||
---@return HighlightedString[]
|
---@return HighlightedString[]
|
||||||
function Builder:_format_line(
|
function Builder:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
|
||||||
indent_markers,
|
|
||||||
arrows,
|
|
||||||
icon,
|
|
||||||
name,
|
|
||||||
git_icons,
|
|
||||||
diagnostics_icon,
|
|
||||||
modified_icon,
|
|
||||||
bookmark_icon
|
|
||||||
)
|
|
||||||
local added_len = 0
|
local added_len = 0
|
||||||
local function add_to_end(t1, t2)
|
local function add_to_end(t1, t2)
|
||||||
for _, v in ipairs(t2) do
|
for _, v in ipairs(t2) do
|
||||||
@@ -430,8 +415,7 @@ function Builder:_build_line(node, idx, num_children, unloaded_bufnr)
|
|||||||
self:_append_highlight(node, diagnostics.get_highlight, icon.hl, name.hl)
|
self:_append_highlight(node, diagnostics.get_highlight, icon.hl, name.hl)
|
||||||
self:_append_highlight(node, copy_paste.get_highlight, icon.hl, name.hl)
|
self:_append_highlight(node, copy_paste.get_highlight, icon.hl, name.hl)
|
||||||
|
|
||||||
local line =
|
local line = self:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
|
||||||
self:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
|
|
||||||
self:_insert_line(self:_unwrap_highlighted_strings(line))
|
self:_insert_line(self:_unwrap_highlighted_strings(line))
|
||||||
|
|
||||||
self.index = self.index + 1
|
self.index = self.index + 1
|
||||||
|
|||||||
@@ -30,9 +30,7 @@ local function get_padding_indent_markers(depth, idx, nodes_number, markers, wit
|
|||||||
for i = 1, depth do
|
for i = 1, depth do
|
||||||
local glyph
|
local glyph
|
||||||
if idx == nodes_number and i == depth then
|
if idx == nodes_number and i == depth then
|
||||||
local bottom_width = M.config.indent_width
|
local bottom_width = M.config.indent_width - 2 + (with_arrows and not inline_arrows and has_folder_sibling and 2 or 0)
|
||||||
- 2
|
|
||||||
+ (with_arrows and not inline_arrows and has_folder_sibling and 2 or 0)
|
|
||||||
glyph = M.config.indent_markers.icons.corner
|
glyph = M.config.indent_markers.icons.corner
|
||||||
.. string.rep(M.config.indent_markers.icons.bottom, bottom_width)
|
.. string.rep(M.config.indent_markers.icons.bottom, bottom_width)
|
||||||
.. (M.config.indent_width > 1 and " " or "")
|
.. (M.config.indent_width > 1 and " " or "")
|
||||||
|
|||||||
@@ -176,9 +176,7 @@ function M.rename_loaded_buffers(old_path, new_path)
|
|||||||
if vim.api.nvim_buf_is_loaded(buf) then
|
if vim.api.nvim_buf_is_loaded(buf) then
|
||||||
local buf_name = vim.api.nvim_buf_get_name(buf)
|
local buf_name = vim.api.nvim_buf_get_name(buf)
|
||||||
local exact_match = buf_name == old_path
|
local exact_match = buf_name == old_path
|
||||||
local child_match = (
|
local child_match = (buf_name:sub(1, #old_path) == old_path and buf_name:sub(#old_path + 1, #old_path + 1) == path_separator)
|
||||||
buf_name:sub(1, #old_path) == old_path and buf_name:sub(#old_path + 1, #old_path + 1) == path_separator
|
|
||||||
)
|
|
||||||
if exact_match or child_match then
|
if exact_match or child_match then
|
||||||
vim.api.nvim_buf_set_name(buf, new_path .. buf_name:sub(#old_path + 1))
|
vim.api.nvim_buf_set_name(buf, new_path .. buf_name:sub(#old_path + 1))
|
||||||
-- to avoid the 'overwrite existing file' error message on write for
|
-- to avoid the 'overwrite existing file' error message on write for
|
||||||
|
|||||||
Reference in New Issue
Block a user