-
-
Notifications
You must be signed in to change notification settings - Fork 623
chore: stylua column width 120 -> 140 #2448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
d4871d7
8a0524d
e01a678
a52e798
8c1d243
2206613
2fa2b83
2d94d17
5f06880
48e5c6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
column_width = 120 | ||
column_width = 140 | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 2 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,18 +16,18 @@ function M.fn(node) | |
stderr = vim.loop.new_pipe(false), | ||
} | ||
table.insert(process.args, node.link_to or node.absolute_path) | ||
process.handle, process.pid = vim.loop.spawn( | ||
process.cmd, | ||
{ args = process.args, stdio = { nil, nil, process.stderr }, detached = true }, | ||
function(code) | ||
process.stderr:read_stop() | ||
process.stderr:close() | ||
process.handle:close() | ||
if code ~= 0 then | ||
notify.warn(string.format("system_open failed with return code %d: %s", code, process.errors)) | ||
end | ||
|
||
local opts = { args = process.args, stdio = { nil, nil, process.stderr }, detached = true } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. broke up |
||
|
||
process.handle, process.pid = vim.loop.spawn(process.cmd, opts, function(code) | ||
process.stderr:read_stop() | ||
process.stderr:close() | ||
process.handle:close() | ||
if code ~= 0 then | ||
notify.warn(string.format("system_open failed with return code %d: %s", code, process.errors)) | ||
end | ||
) | ||
end) | ||
|
||
table.remove(process.args) | ||
if not process.handle then | ||
notify.warn(string.format("system_open failed to spawn command '%s': %s", process.cmd, process.pid)) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,11 +95,9 @@ function M.update() | |
for line, node in pairs(nodes_by_line) do | ||
local nodepath = utils.canonical_path(node.absolute_path) | ||
log.line("diagnostics", " %d checking nodepath '%s'", line, nodepath) | ||
if | ||
M.show_on_dirs | ||
and vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/") | ||
and (not node.open or M.show_on_open_dirs) | ||
then | ||
|
||
local node_contains_buf = vim.startswith(bufpath:gsub("\\", "/"), nodepath:gsub("\\", "/") .. "/") | ||
if M.show_on_dirs and node_contains_buf and (not node.open or M.show_on_open_dirs) then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Broke up. |
||
log.line("diagnostics", " matched fold node '%s'", node.absolute_path) | ||
node.diag_status = severity | ||
elseif nodepath == bufpath then | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,11 +94,7 @@ end | |
local function nil_() end | ||
|
||
local function warn_status(git_status) | ||
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.' | ||
) | ||
notify.warn(string.format("Unrecognized git state '%s'", git_status)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Message is no longer needed; we were fishing for unknown statuses. |
||
end | ||
|
||
---@param node table | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,14 +73,10 @@ function Event:start() | |
|
||
rc, _, name = self._fs_event:start(self._path, FS_EVENT_FLAGS, event_cb) | ||
if rc ~= 0 then | ||
local warning = string.format("Could not start the fs_event watcher for path %s : %s", self._path, name) | ||
if name == "EMFILE" then | ||
M.disable_watchers( | ||
warning, | ||
"Please see https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting#could-not-start-fs_event-for-path--emfile" | ||
) | ||
M.disable_watchers "fs.inotify.max_user_watches exceeded, see https://github.com/nvim-tree/nvim-tree.lua/wiki/Troubleshooting" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tidied message. |
||
else | ||
notify.warn(warning) | ||
notify.warn(string.format("Could not start the fs_event watcher for path %s : %s", self._path, name)) | ||
end | ||
return false | ||
end | ||
|
@@ -164,10 +160,9 @@ end | |
M.Watcher = Watcher | ||
|
||
--- Permanently disable watchers and purge all state following a catastrophic error. | ||
--- @param warning string | ||
--- @param detail string | ||
function M.disable_watchers(warning, detail) | ||
notify.warn(string.format("%s Disabling watchers: %s", warning, detail)) | ||
--- @param msg string | ||
function M.disable_watchers(msg) | ||
notify.warn(string.format("Disabling watchers: %s", msg)) | ||
M.config.filesystem_watchers.enable = false | ||
require("nvim-tree").purge_all_state() | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Action is obvious :)