chore: stylua column width 120 -> 140

This commit is contained in:
Alexander Courtis
2023-10-07 14:54:58 +11:00
parent 85abe29396
commit d4871d726b
12 changed files with 16 additions and 69 deletions

View File

@@ -52,9 +52,7 @@ function M.fn(default_modifier)
-- support for only specific modifiers have been implemented
if not ALLOWED_MODIFIERS[modifier] then
return notify.warn(
"Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ",")
)
return notify.warn("Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ","))
end
node = lib.get_last_group_node(node)

View File

@@ -47,8 +47,7 @@ local function gen_iterator()
end
end)
:recursor(function(node)
return expansion_count < M.MAX_FOLDER_DISCOVERY
and (node.group_next and { node.group_next } or (node.open and node.nodes))
return expansion_count < M.MAX_FOLDER_DISCOVERY and (node.group_next and { node.group_next } or (node.open and node.nodes))
end)
:iterate()

View File

@@ -30,11 +30,7 @@ local function populate_children(handle, cwd, node, git_status)
local profile = log.profile_start("explore populate_children %s", abs)
t = get_type_from(t, abs)
if
not filters.should_filter(abs, filter_status)
and not nodes_by_path[abs]
and Watcher.is_fs_event_capable(abs)
then
if not filters.should_filter(abs, filter_status) and not nodes_by_path[abs] and Watcher.is_fs_event_capable(abs) then
local child = nil
if t == "directory" and vim.loop.fs_access(abs, "R") then
child = builders.folder(node, abs, name)

View File

@@ -121,10 +121,7 @@ function M.should_filter(path, status)
return false
end
return git(path, status.git_status)
or buf(path, status.bufinfo, status.unloaded_bufnr)
or dotfile(path)
or custom(path)
return git(path, status.git_status) or buf(path, status.bufinfo, status.unloaded_bufnr) or dotfile(path) or custom(path)
end
function M.setup(opts)

View File

@@ -109,8 +109,7 @@ local function compute()
-- header, not padded
local hl = { { "NvimTreeRootFolder", 0, 0, #head_lhs } }
local lines =
{ ("%s%s%s"):format(head_lhs, string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs + 2), head_rhs) }
local lines = { ("%s%s%s"):format(head_lhs, string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs + 2), head_rhs) }
local width = #lines[1]
-- mappings, left padded 1
@@ -177,12 +176,7 @@ local function open()
vim.wo[M.winnr].cursorline = M.config.cursorline
-- quit binding
vim.keymap.set(
"n",
"q",
close,
{ desc = "nvim-tree: exit help", buffer = M.bufnr, noremap = true, silent = true, nowait = true }
)
vim.keymap.set("n", "q", close, { desc = "nvim-tree: exit help", buffer = M.bufnr, noremap = true, silent = true, nowait = true })
-- close window and delete buffer on leave
vim.api.nvim_create_autocmd({ "BufLeave", "WinLeave" }, {

View File

@@ -40,15 +40,7 @@ local function refactored(opts)
utils.move_missing_val(opts, "git", "ignore", opts, "filters", "git_ignored", true)
-- 2023/08/26
utils.move_missing_val(
opts,
"renderer.icons",
"webdev_colors",
opts,
"renderer.icons.web_devicons.file",
"color",
true
)
utils.move_missing_val(opts, "renderer.icons", "webdev_colors", opts, "renderer.icons.web_devicons.file", "color", true)
end
local function deprecated(opts)

View File

@@ -7,15 +7,12 @@ local config = {
local title_support
function M.supports_title()
-- TODO increase stylua column_width
-- stylua: ignore start
if title_support == nil then
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.notifier and require("notifier.config").has_component "nvim")
or false
end
-- stylua: ignore end
return title_support
end

View File

@@ -168,9 +168,7 @@ function Builder:_build_folder(node)
local link_to = utils.path_relative(node.link_to, core.get_cwd())
foldername = foldername .. arrow .. link_to
foldername_hl = "NvimTreeSymlinkFolderName"
elseif
vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name)
then
elseif vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name) then
foldername_hl = "NvimTreeSpecialFolderName"
elseif node.open then
foldername_hl = "NvimTreeOpenedFolderName"
@@ -278,11 +276,7 @@ function Builder:_get_highlight_override(node, unloaded_bufnr)
end
-- opened file
if
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 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
name_hl = "NvimTreeOpenedFile"
end
@@ -331,16 +325,7 @@ end
---@param modified_icon HighlightedString|nil
---@param bookmark_icon HighlightedString|nil
---@return HighlightedString[]
function Builder:_format_line(
indent_markers,
arrows,
icon,
name,
git_icons,
diagnostics_icon,
modified_icon,
bookmark_icon
)
function Builder:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
local added_len = 0
local function add_to_end(t1, t2)
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, copy_paste.get_highlight, icon.hl, name.hl)
local line =
self:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
local line = 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.index = self.index + 1

View File

@@ -30,9 +30,7 @@ local function get_padding_indent_markers(depth, idx, nodes_number, markers, wit
for i = 1, depth do
local glyph
if idx == nodes_number and i == depth then
local bottom_width = M.config.indent_width
- 2
+ (with_arrows and not inline_arrows and has_folder_sibling and 2 or 0)
local bottom_width = M.config.indent_width - 2 + (with_arrows and not inline_arrows and has_folder_sibling and 2 or 0)
glyph = M.config.indent_markers.icons.corner
.. string.rep(M.config.indent_markers.icons.bottom, bottom_width)
.. (M.config.indent_width > 1 and " " or "")

View File

@@ -176,9 +176,7 @@ function M.rename_loaded_buffers(old_path, new_path)
if vim.api.nvim_buf_is_loaded(buf) then
local buf_name = vim.api.nvim_buf_get_name(buf)
local exact_match = buf_name == old_path
local child_match = (
buf_name:sub(1, #old_path) == old_path and buf_name:sub(#old_path + 1, #old_path + 1) == path_separator
)
local child_match = (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
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