Skip to content

Commit 53b0bca

Browse files
authored
chore: stylua column width 120 -> 140 (#2448)
* chore: stylua column width 120 -> 140 * chore: stylua column width 120 -> 140, tidy * Revert "chore: stylua column width 120 -> 140, tidy" This reverts commit 8a0524d. * chore: stylua column width 120 -> 140, tidy watcher.lua * chore: stylua column width 120 -> 140, tidy diagnostics.lua * chore: stylua column width 120 -> 140, tidy git.lua * chore: stylua column width 120 -> 140, tidy open-file.lua * chore: stylua column width 120 -> 140, tidy system-open.lua * chore: stylua column width 120 -> 140, tidy runner.lua
1 parent 94e572e commit 53b0bca

File tree

18 files changed

+38
-114
lines changed

18 files changed

+38
-114
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/node/open-file.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,7 @@ local function pick_win_id()
6262
end
6363

6464
if #M.window_picker.chars < #selectable then
65-
notify.error(
66-
string.format(
67-
"More windows (%d) than actions.open_file.window_picker.chars (%d) - please add more.",
68-
#selectable,
69-
#M.window_picker.chars
70-
)
71-
)
65+
notify.error(string.format("More windows (%d) than actions.open_file.window_picker.chars (%d).", #selectable, #M.window_picker.chars))
7266
return nil
7367
end
7468

lua/nvim-tree/actions/node/system-open.lua

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ function M.fn(node)
1616
stderr = vim.loop.new_pipe(false),
1717
}
1818
table.insert(process.args, node.link_to or node.absolute_path)
19-
process.handle, process.pid = vim.loop.spawn(
20-
process.cmd,
21-
{ args = process.args, stdio = { nil, nil, process.stderr }, detached = true },
22-
function(code)
23-
process.stderr:read_stop()
24-
process.stderr:close()
25-
process.handle:close()
26-
if code ~= 0 then
27-
notify.warn(string.format("system_open failed with return code %d: %s", code, process.errors))
28-
end
19+
20+
local opts = { args = process.args, stdio = { nil, nil, process.stderr }, detached = true }
21+
22+
process.handle, process.pid = vim.loop.spawn(process.cmd, opts, function(code)
23+
process.stderr:read_stop()
24+
process.stderr:close()
25+
process.handle:close()
26+
if code ~= 0 then
27+
notify.warn(string.format("system_open failed with return code %d: %s", code, process.errors))
2928
end
30-
)
29+
end)
30+
3131
table.remove(process.args)
3232
if not process.handle then
3333
notify.warn(string.format("system_open failed to spawn command '%s': %s", process.cmd, process.pid))

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/diagnostics.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,9 @@ function M.update()
9595
for line, node in pairs(nodes_by_line) do
9696
local nodepath = utils.canonical_path(node.absolute_path)
9797
log.line("diagnostics", " %d checking nodepath '%s'", line, nodepath)
98-
if
99-
M.show_on_dirs
100-
and vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/")
101-
and (not node.open or M.show_on_open_dirs)
102-
then
98+
99+
local node_contains_buf = vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/")
100+
if M.show_on_dirs and node_contains_buf and (not node.open or M.show_on_open_dirs) then
103101
log.line("diagnostics", " matched fold node '%s'", node.absolute_path)
104102
node.diag_status = severity
105103
elseif nodepath == bufpath then

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/git/runner.lua

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,7 @@ function Runner:_finalise(opts)
156156
log.line("git", "job timed out %s %s", opts.toplevel, opts.path)
157157
timeouts = timeouts + 1
158158
if timeouts == MAX_TIMEOUTS then
159-
notify.warn(
160-
string.format(
161-
"%d git jobs have timed out after %dms, disabling git integration. Try increasing git.timeout",
162-
timeouts,
163-
opts.timeout
164-
)
165-
)
159+
notify.warn(string.format("%d git jobs have timed out after git.timeout %dms, disabling git integration.", timeouts, opts.timeout))
166160
require("nvim-tree.git").disable_git_integration()
167161
end
168162
elseif self.rc ~= 0 then

0 commit comments

Comments
 (0)