Skip to content

Commit d4871d7

Browse files
committed
chore: stylua column width 120 -> 140
1 parent 85abe29 commit d4871d7

File tree

12 files changed

+16
-69
lines changed

12 files changed

+16
-69
lines changed

.stylua.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
column_width = 120
1+
column_width = 140
22
line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2

lua/nvim-tree.lua

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,7 @@ local function setup_autocommands(opts)
218218
create_nvim_tree_autocmd("BufReadPost", {
219219
callback = function(data)
220220
-- update opened file buffers
221-
if
222-
(filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none")
223-
and vim.bo[data.buf].buftype == ""
224-
then
221+
if (filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none") and vim.bo[data.buf].buftype == "" then
225222
utils.debounce("Buf:filter_buffer", opts.view.debounce_delay, function()
226223
reloaders.reload_explorer()
227224
end)
@@ -232,10 +229,7 @@ local function setup_autocommands(opts)
232229
create_nvim_tree_autocmd("BufUnload", {
233230
callback = function(data)
234231
-- update opened file buffers
235-
if
236-
(filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none")
237-
and vim.bo[data.buf].buftype == ""
238-
then
232+
if (filters.config.filter_no_buffer or renderer.config.highlight_opened_files ~= "none") and vim.bo[data.buf].buftype == "" then
239233
utils.debounce("Buf:filter_buffer", opts.view.debounce_delay, function()
240234
reloaders.reload_explorer(nil, data.buf)
241235
end)

lua/nvim-tree/actions/fs/rename-file.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,7 @@ function M.fn(default_modifier)
5252

5353
-- support for only specific modifiers have been implemented
5454
if not ALLOWED_MODIFIERS[modifier] then
55-
return notify.warn(
56-
"Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ",")
57-
)
55+
return notify.warn("Modifier " .. vim.inspect(modifier) .. " is not in allowed list : " .. table.concat(ALLOWED_MODIFIERS, ","))
5856
end
5957

6058
node = lib.get_last_group_node(node)

lua/nvim-tree/actions/tree-modifiers/expand-all.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ local function gen_iterator()
4747
end
4848
end)
4949
:recursor(function(node)
50-
return expansion_count < M.MAX_FOLDER_DISCOVERY
51-
and (node.group_next and { node.group_next } or (node.open and node.nodes))
50+
return expansion_count < M.MAX_FOLDER_DISCOVERY and (node.group_next and { node.group_next } or (node.open and node.nodes))
5251
end)
5352
:iterate()
5453

lua/nvim-tree/explorer/explore.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ local function populate_children(handle, cwd, node, git_status)
3030
local profile = log.profile_start("explore populate_children %s", abs)
3131

3232
t = get_type_from(t, abs)
33-
if
34-
not filters.should_filter(abs, filter_status)
35-
and not nodes_by_path[abs]
36-
and Watcher.is_fs_event_capable(abs)
37-
then
33+
if not filters.should_filter(abs, filter_status) and not nodes_by_path[abs] and Watcher.is_fs_event_capable(abs) then
3834
local child = nil
3935
if t == "directory" and vim.loop.fs_access(abs, "R") then
4036
child = builders.folder(node, abs, name)

lua/nvim-tree/explorer/filters.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ function M.should_filter(path, status)
121121
return false
122122
end
123123

124-
return git(path, status.git_status)
125-
or buf(path, status.bufinfo, status.unloaded_bufnr)
126-
or dotfile(path)
127-
or custom(path)
124+
return git(path, status.git_status) or buf(path, status.bufinfo, status.unloaded_bufnr) or dotfile(path) or custom(path)
128125
end
129126

130127
function M.setup(opts)

lua/nvim-tree/help.lua

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ local function compute()
109109

110110
-- header, not padded
111111
local hl = { { "NvimTreeRootFolder", 0, 0, #head_lhs } }
112-
local lines =
113-
{ ("%s%s%s"):format(head_lhs, string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs + 2), head_rhs) }
112+
local lines = { ("%s%s%s"):format(head_lhs, string.rep(" ", max_desc + max_lhs - #head_lhs - #head_rhs + 2), head_rhs) }
114113
local width = #lines[1]
115114

116115
-- mappings, left padded 1
@@ -177,12 +176,7 @@ local function open()
177176
vim.wo[M.winnr].cursorline = M.config.cursorline
178177

179178
-- quit binding
180-
vim.keymap.set(
181-
"n",
182-
"q",
183-
close,
184-
{ desc = "nvim-tree: exit help", buffer = M.bufnr, noremap = true, silent = true, nowait = true }
185-
)
179+
vim.keymap.set("n", "q", close, { desc = "nvim-tree: exit help", buffer = M.bufnr, noremap = true, silent = true, nowait = true })
186180

187181
-- close window and delete buffer on leave
188182
vim.api.nvim_create_autocmd({ "BufLeave", "WinLeave" }, {

lua/nvim-tree/legacy.lua

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,7 @@ local function refactored(opts)
4040
utils.move_missing_val(opts, "git", "ignore", opts, "filters", "git_ignored", true)
4141

4242
-- 2023/08/26
43-
utils.move_missing_val(
44-
opts,
45-
"renderer.icons",
46-
"webdev_colors",
47-
opts,
48-
"renderer.icons.web_devicons.file",
49-
"color",
50-
true
51-
)
43+
utils.move_missing_val(opts, "renderer.icons", "webdev_colors", opts, "renderer.icons.web_devicons.file", "color", true)
5244
end
5345

5446
local function deprecated(opts)

lua/nvim-tree/notify.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ local config = {
77

88
local title_support
99
function M.supports_title()
10-
-- TODO increase stylua column_width
11-
-- stylua: ignore start
1210
if title_support == nil then
1311
title_support = (package.loaded.notify and (vim.notify == require "notify" or vim.notify == require("notify").notify))
1412
or (package.loaded.noice and (vim.notify == require("noice").notify or vim.notify == require("noice.source.notify").notify))
1513
or (package.loaded.notifier and require("notifier.config").has_component "nvim")
1614
or false
1715
end
18-
-- stylua: ignore end
1916

2017
return title_support
2118
end

lua/nvim-tree/renderer/builder.lua

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,7 @@ function Builder:_build_folder(node)
168168
local link_to = utils.path_relative(node.link_to, core.get_cwd())
169169
foldername = foldername .. arrow .. link_to
170170
foldername_hl = "NvimTreeSymlinkFolderName"
171-
elseif
172-
vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name)
173-
then
171+
elseif vim.tbl_contains(self.special_files, node.absolute_path) or vim.tbl_contains(self.special_files, node.name) then
174172
foldername_hl = "NvimTreeSpecialFolderName"
175173
elseif node.open then
176174
foldername_hl = "NvimTreeOpenedFolderName"
@@ -278,11 +276,7 @@ function Builder:_get_highlight_override(node, unloaded_bufnr)
278276
end
279277

280278
-- opened file
281-
if
282-
self.highlight_opened_files
283-
and vim.fn.bufloaded(node.absolute_path) > 0
284-
and vim.fn.bufnr(node.absolute_path) ~= unloaded_bufnr
285-
then
279+
if self.highlight_opened_files and vim.fn.bufloaded(node.absolute_path) > 0 and vim.fn.bufnr(node.absolute_path) ~= unloaded_bufnr then
286280
if self.highlight_opened_files == "all" or self.highlight_opened_files == "name" then
287281
name_hl = "NvimTreeOpenedFile"
288282
end
@@ -331,16 +325,7 @@ end
331325
---@param modified_icon HighlightedString|nil
332326
---@param bookmark_icon HighlightedString|nil
333327
---@return HighlightedString[]
334-
function Builder:_format_line(
335-
indent_markers,
336-
arrows,
337-
icon,
338-
name,
339-
git_icons,
340-
diagnostics_icon,
341-
modified_icon,
342-
bookmark_icon
343-
)
328+
function Builder:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
344329
local added_len = 0
345330
local function add_to_end(t1, t2)
346331
for _, v in ipairs(t2) do
@@ -430,8 +415,7 @@ function Builder:_build_line(node, idx, num_children, unloaded_bufnr)
430415
self:_append_highlight(node, diagnostics.get_highlight, icon.hl, name.hl)
431416
self:_append_highlight(node, copy_paste.get_highlight, icon.hl, name.hl)
432417

433-
local line =
434-
self:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
418+
local line = self:_format_line(indent_markers, arrows, icon, name, git_icons, diagnostics_icon, modified_icon, bookmark_icon)
435419
self:_insert_line(self:_unwrap_highlighted_strings(line))
436420

437421
self.index = self.index + 1

lua/nvim-tree/renderer/components/padding.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ local function get_padding_indent_markers(depth, idx, nodes_number, markers, wit
3030
for i = 1, depth do
3131
local glyph
3232
if idx == nodes_number and i == depth then
33-
local bottom_width = M.config.indent_width
34-
- 2
35-
+ (with_arrows and not inline_arrows and has_folder_sibling and 2 or 0)
33+
local bottom_width = M.config.indent_width - 2 + (with_arrows and not inline_arrows and has_folder_sibling and 2 or 0)
3634
glyph = M.config.indent_markers.icons.corner
3735
.. string.rep(M.config.indent_markers.icons.bottom, bottom_width)
3836
.. (M.config.indent_width > 1 and " " or "")

lua/nvim-tree/utils.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,7 @@ function M.rename_loaded_buffers(old_path, new_path)
176176
if vim.api.nvim_buf_is_loaded(buf) then
177177
local buf_name = vim.api.nvim_buf_get_name(buf)
178178
local exact_match = buf_name == old_path
179-
local child_match = (
180-
buf_name:sub(1, #old_path) == old_path and buf_name:sub(#old_path + 1, #old_path + 1) == path_separator
181-
)
179+
local child_match = (buf_name:sub(1, #old_path) == old_path and buf_name:sub(#old_path + 1, #old_path + 1) == path_separator)
182180
if exact_match or child_match then
183181
vim.api.nvim_buf_set_name(buf, new_path .. buf_name:sub(#old_path + 1))
184182
-- to avoid the 'overwrite existing file' error message on write for

0 commit comments

Comments
 (0)