Skip to content

Commit 8a0524d

Browse files
committed
chore: stylua column width 120 -> 140, tidy
1 parent d4871d7 commit 8a0524d

File tree

8 files changed

+18
-50
lines changed

8 files changed

+18
-50
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 = 140
1+
column_width = 160
22
line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2

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) - please add more.", #selectable, #M.window_picker.chars))
7266
return nil
7367
end
7468

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

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,14 @@ 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+
process.handle, process.pid = vim.loop.spawn(process.cmd, { args = process.args, stdio = { nil, nil, process.stderr }, detached = true }, function(code)
20+
process.stderr:read_stop()
21+
process.stderr:close()
22+
process.handle:close()
23+
if code ~= 0 then
24+
notify.warn(string.format("system_open failed with return code %d: %s", code, process.errors))
2925
end
30-
)
26+
end)
3127
table.remove(process.args)
3228
if not process.handle then
3329
notify.warn(string.format("system_open failed to spawn command '%s': %s", process.cmd, process.pid))

lua/nvim-tree/diagnostics.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,7 @@ 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+
if M.show_on_dirs and vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/") and (not node.open or M.show_on_open_dirs) then
10399
log.line("diagnostics", " matched fold node '%s'", node.absolute_path)
104100
node.diag_status = severity
105101
elseif nodepath == bufpath then

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 %dms, disabling git integration. Try increasing git.timeout", timeouts, opts.timeout))
166160
require("nvim-tree.git").disable_git_integration()
167161
end
168162
elseif self.rc ~= 0 then

lua/nvim-tree/modified.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ end
2626
---@param node table
2727
---@return boolean
2828
function M.is_modified(node)
29-
return M.config.enable
30-
and M._record[node.absolute_path]
31-
and (not node.nodes or M.config.show_on_dirs)
32-
and (not node.open or M.config.show_on_open_dirs)
29+
return M.config.enable and M._record[node.absolute_path] and (not node.nodes or M.config.show_on_dirs) and (not node.open or M.config.show_on_open_dirs)
3330
end
3431

3532
---@param opts table

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,7 @@ end
9494
local function nil_() end
9595

9696
local function warn_status(git_status)
97-
notify.warn(
98-
'Unrecognized git state "'
99-
.. git_status
100-
.. '". Please open up an issue on https://github.com/nvim-tree/nvim-tree.lua/issues with this message.'
101-
)
97+
notify.warn('Unrecognized git state "' .. git_status .. '". Please open up an issue on https://github.com/nvim-tree/nvim-tree.lua/issues with this message.')
10298
end
10399

104100
---@param node table

lua/nvim-tree/watcher.lua

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,10 @@ function Event:start()
7373

7474
rc, _, name = self._fs_event:start(self._path, FS_EVENT_FLAGS, event_cb)
7575
if rc ~= 0 then
76-
local warning = string.format("Could not start the fs_event watcher for path %s : %s", self._path, name)
7776
if name == "EMFILE" then
78-
M.disable_watchers(
79-
warning,
80-
"Please see https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#could-not-start-fs_event-for-path--emfile"
81-
)
77+
M.disable_watchers "fs.inotify.max_user_watches exceeded, see https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting"
8278
else
83-
notify.warn(warning)
79+
notify.warn(string.format("Could not start the fs_event watcher for path %s : %s", self._path, name))
8480
end
8581
return false
8682
end
@@ -164,10 +160,9 @@ end
164160
M.Watcher = Watcher
165161

166162
--- Permanently disable watchers and purge all state following a catastrophic error.
167-
--- @param warning string
168-
--- @param detail string
169-
function M.disable_watchers(warning, detail)
170-
notify.warn(string.format("%s Disabling watchers: %s", warning, detail))
163+
--- @param msg string
164+
function M.disable_watchers(msg)
165+
notify.warn(string.format("Disabling watchers: %s", msg))
171166
M.config.filesystem_watchers.enable = false
172167
require("nvim-tree").purge_all_state()
173168
end

0 commit comments

Comments
 (0)