Skip to content

Commit 49a8cf7

Browse files
committed
stylua -> EmmyLuaCodeStyle: call_arg_parentheses = always
1 parent 1429801 commit 49a8cf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+450
-448
lines changed

lua/nvim-tree.lua

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
local lib = require "nvim-tree.lib"
2-
local log = require "nvim-tree.log"
3-
local appearance = require "nvim-tree.appearance"
4-
local view = require "nvim-tree.view"
5-
local utils = require "nvim-tree.utils"
6-
local actions = require "nvim-tree.actions"
7-
local core = require "nvim-tree.core"
8-
local notify = require "nvim-tree.notify"
1+
local lib = require("nvim-tree.lib")
2+
local log = require("nvim-tree.log")
3+
local appearance = require("nvim-tree.appearance")
4+
local view = require("nvim-tree.view")
5+
local utils = require("nvim-tree.utils")
6+
local actions = require("nvim-tree.actions")
7+
local core = require("nvim-tree.core")
8+
local notify = require("nvim-tree.notify")
99

1010
local _config = {}
1111

@@ -21,7 +21,7 @@ function M.change_root(path, bufnr)
2121
if type(bufnr) == "number" then
2222
local ft
2323

24-
if vim.fn.has "nvim-0.10" == 1 then
24+
if vim.fn.has("nvim-0.10") == 1 then
2525
ft = vim.api.nvim_get_option_value("filetype", { buf = bufnr }) or ""
2626
else
2727
ft = vim.api.nvim_buf_get_option(bufnr, "filetype") or "" ---@diagnostic disable-line: deprecated
@@ -76,11 +76,11 @@ function M.change_root(path, bufnr)
7676
end
7777

7878
function M.tab_enter()
79-
if view.is_visible { any_tabpage = true } then
79+
if view.is_visible({ any_tabpage = true }) then
8080
local bufname = vim.api.nvim_buf_get_name(0)
8181

8282
local ft
83-
if vim.fn.has "nvim-0.10" == 1 then
83+
if vim.fn.has("nvim-0.10") == 1 then
8484
ft = vim.api.nvim_get_option_value("filetype", { buf = 0 }) or ""
8585
else
8686
ft = vim.api.nvim_buf_get_option(0, "ft") ---@diagnostic disable-line: deprecated
@@ -91,7 +91,7 @@ function M.tab_enter()
9191
return
9292
end
9393
end
94-
view.open { focus_tree = false }
94+
view.open({ focus_tree = false })
9595

9696
local explorer = core.get_explorer()
9797
if explorer then
@@ -145,8 +145,8 @@ end
145145
---@param hijack_netrw boolean
146146
local function manage_netrw(disable_netrw, hijack_netrw)
147147
if hijack_netrw then
148-
vim.cmd "silent! autocmd! FileExplorer *"
149-
vim.cmd "autocmd VimEnter * ++once silent! autocmd! FileExplorer *"
148+
vim.cmd("silent! autocmd! FileExplorer *")
149+
vim.cmd("autocmd VimEnter * ++once silent! autocmd! FileExplorer *")
150150
end
151151
if disable_netrw then
152152
vim.g.loaded_netrw = 1
@@ -316,7 +316,7 @@ local function setup_autocommands(opts)
316316
callback = function()
317317
vim.schedule(function()
318318
vim.api.nvim_buf_call(0, function()
319-
vim.cmd [[norm! zz]]
319+
vim.cmd([[norm! zz]])
320320
end)
321321
end)
322322
end,
@@ -811,8 +811,8 @@ end
811811

812812
---@param conf table|nil
813813
function M.setup(conf)
814-
if vim.fn.has "nvim-0.9" == 0 then
815-
notify.warn "nvim-tree.lua requires Neovim 0.9 or higher"
814+
if vim.fn.has("nvim-0.9") == 0 then
815+
notify.warn("nvim-tree.lua requires Neovim 0.9 or higher")
816816
return
817817
end
818818

@@ -840,7 +840,7 @@ function M.setup(conf)
840840
require("nvim-tree.notify").setup(opts)
841841
require("nvim-tree.log").setup(opts)
842842

843-
if log.enabled "config" then
843+
if log.enabled("config") then
844844
log.line("config", "default config + user")
845845
log.raw("config", "%s\n", vim.inspect(opts))
846846
end

lua/nvim-tree/actions/finders/find-file.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
local log = require "nvim-tree.log"
2-
local view = require "nvim-tree.view"
3-
local utils = require "nvim-tree.utils"
4-
local core = require "nvim-tree.core"
5-
local Iterator = require "nvim-tree.iterators.node-iterator"
1+
local log = require("nvim-tree.log")
2+
local view = require("nvim-tree.view")
3+
local utils = require("nvim-tree.utils")
4+
local core = require("nvim-tree.core")
5+
local Iterator = require("nvim-tree.iterators.node-iterator")
66

77
local M = {}
88

@@ -76,7 +76,7 @@ function M.fn(path)
7676

7777
if found and view.is_visible() then
7878
explorer.renderer:draw()
79-
view.set_cursor { line, 0 }
79+
view.set_cursor({ line, 0 })
8080
end
8181

8282
running[path_real] = false
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local M = {}
22

3-
M.find_file = require "nvim-tree.actions.finders.find-file"
4-
M.search_node = require "nvim-tree.actions.finders.search-node"
3+
M.find_file = require("nvim-tree.actions.finders.find-file")
4+
M.search_node = require("nvim-tree.actions.finders.search-node")
55

66
return M

lua/nvim-tree/actions/finders/search-node.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
local core = require "nvim-tree.core"
1+
local core = require("nvim-tree.core")
22
local find_file = require("nvim-tree.actions.finders.find-file").fn
33

44
local M = {}
@@ -75,7 +75,7 @@ function M.fn()
7575
local bufnr = vim.api.nvim_get_current_buf()
7676

7777
local path_existed, path_opt
78-
if vim.fn.has "nvim-0.10" == 1 then
78+
if vim.fn.has("nvim-0.10") == 1 then
7979
path_existed, path_opt = pcall(vim.api.nvim_get_option_value, "path", { buf = bufnr })
8080
vim.api.nvim_set_option_value("path", core.get_cwd() .. "/**", { buf = bufnr })
8181
else
@@ -89,13 +89,13 @@ function M.fn()
8989
end
9090
-- reset &path
9191
if path_existed then
92-
if vim.fn.has "nvim-0.10" == 1 then
92+
if vim.fn.has("nvim-0.10") == 1 then
9393
vim.api.nvim_set_option_value("path", path_opt, { buf = bufnr })
9494
else
9595
vim.api.nvim_buf_set_option(bufnr, "path", path_opt) ---@diagnostic disable-line: deprecated
9696
end
9797
else
98-
if vim.fn.has "nvim-0.10" == 1 then
98+
if vim.fn.has("nvim-0.10") == 1 then
9999
vim.api.nvim_set_option_value("path", nil, { buf = bufnr })
100100
else
101101
vim.api.nvim_buf_set_option(bufnr, "path", nil) ---@diagnostic disable-line: deprecated

lua/nvim-tree/actions/fs/clipboard.lua

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
local lib = require "nvim-tree.lib"
2-
local log = require "nvim-tree.log"
3-
local utils = require "nvim-tree.utils"
4-
local core = require "nvim-tree.core"
5-
local events = require "nvim-tree.events"
6-
local notify = require "nvim-tree.notify"
1+
local lib = require("nvim-tree.lib")
2+
local log = require("nvim-tree.log")
3+
local utils = require("nvim-tree.utils")
4+
local core = require("nvim-tree.core")
5+
local events = require("nvim-tree.events")
6+
local notify = require("nvim-tree.notify")
77

88
local find_file = require("nvim-tree.actions.finders.find-file").fn
99

@@ -89,8 +89,8 @@ local function do_copy(source, destination)
8989
break
9090
end
9191

92-
local new_name = utils.path_join { source, name }
93-
local new_destination = utils.path_join { destination, name }
92+
local new_name = utils.path_join({ source, name })
93+
local new_destination = utils.path_join({ destination, name })
9494
success, errmsg = do_copy(new_name, new_destination)
9595
if not success then
9696
return false, errmsg
@@ -191,7 +191,7 @@ end
191191
function Clipboard:clear_clipboard()
192192
self.data[ACTION.copy] = {}
193193
self.data[ACTION.cut] = {}
194-
notify.info "Clipboard has been emptied."
194+
notify.info("Clipboard has been emptied.")
195195
self.explorer.renderer:draw()
196196
end
197197

@@ -240,7 +240,7 @@ function Clipboard:do_paste(node, action, action_fn)
240240
end
241241

242242
for _, _node in ipairs(clip) do
243-
local dest = utils.path_join { destination, _node.name }
243+
local dest = utils.path_join({ destination, _node.name })
244244
do_single_paste(_node.absolute_path, dest, action, action_fn)
245245
end
246246

@@ -361,7 +361,7 @@ function Clipboard:copy_path(node)
361361

362362
if node.name == ".." then
363363
-- root
364-
content = utils.path_add_trailing ""
364+
content = utils.path_add_trailing("")
365365
else
366366
-- node
367367
local absolute_path = node.absolute_path

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
local utils = require "nvim-tree.utils"
2-
local events = require "nvim-tree.events"
3-
local lib = require "nvim-tree.lib"
4-
local core = require "nvim-tree.core"
5-
local notify = require "nvim-tree.notify"
1+
local utils = require("nvim-tree.utils")
2+
local events = require("nvim-tree.events")
3+
local lib = require("nvim-tree.lib")
4+
local core = require("nvim-tree.core")
5+
local notify = require("nvim-tree.notify")
66

77
local find_file = require("nvim-tree.actions.finders.find-file").fn
88

@@ -72,7 +72,7 @@ function M.fn(node)
7272
end
7373

7474
if utils.file_exists(new_file_path) then
75-
notify.warn "Cannot create: file already exists"
75+
notify.warn("Cannot create: file already exists")
7676
return
7777
end
7878

@@ -87,10 +87,10 @@ function M.fn(node)
8787
for path in utils.path_split(new_file_path) do
8888
idx = idx + 1
8989
local p = utils.path_remove_trailing(path)
90-
if #path_to_create == 0 and vim.fn.has "win32" == 1 then
91-
path_to_create = utils.path_join { p, path_to_create }
90+
if #path_to_create == 0 and vim.fn.has("win32") == 1 then
91+
path_to_create = utils.path_join({ p, path_to_create })
9292
else
93-
path_to_create = utils.path_join { path_to_create, p }
93+
path_to_create = utils.path_join({ path_to_create, p })
9494
end
9595
if is_last_path_file and idx == num_nodes then
9696
create_and_notify(path_to_create)

lua/nvim-tree/actions/fs/init.lua

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
local M = {}
22

3-
M.create_file = require "nvim-tree.actions.fs.create-file"
4-
M.remove_file = require "nvim-tree.actions.fs.remove-file"
5-
M.rename_file = require "nvim-tree.actions.fs.rename-file"
6-
M.trash = require "nvim-tree.actions.fs.trash"
3+
M.create_file = require("nvim-tree.actions.fs.create-file")
4+
M.remove_file = require("nvim-tree.actions.fs.remove-file")
5+
M.rename_file = require("nvim-tree.actions.fs.rename-file")
6+
M.trash = require("nvim-tree.actions.fs.trash")
77

88
function M.setup(opts)
99
M.remove_file.setup(opts)

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

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
local core = require "nvim-tree.core"
2-
local utils = require "nvim-tree.utils"
3-
local events = require "nvim-tree.events"
4-
local view = require "nvim-tree.view"
5-
local lib = require "nvim-tree.lib"
6-
local notify = require "nvim-tree.notify"
1+
local core = require("nvim-tree.core")
2+
local utils = require("nvim-tree.utils")
3+
local events = require("nvim-tree.events")
4+
local view = require("nvim-tree.view")
5+
local lib = require("nvim-tree.lib")
6+
local notify = require("nvim-tree.notify")
77

88
local M = {
99
config = {},
@@ -27,13 +27,13 @@ end
2727

2828
---@param absolute_path string
2929
local function clear_buffer(absolute_path)
30-
local bufs = vim.fn.getbufinfo { bufloaded = 1, buflisted = 1 }
30+
local bufs = vim.fn.getbufinfo({ bufloaded = 1, buflisted = 1 })
3131
for _, buf in pairs(bufs) do
3232
if buf.name == absolute_path then
3333
local tree_winnr = vim.api.nvim_get_current_win()
3434
if buf.hidden == 0 and (#bufs > 1 or view.View.float.enable) then
3535
vim.api.nvim_set_current_win(buf.windows[1])
36-
vim.cmd ":bn"
36+
vim.cmd(":bn")
3737
end
3838
vim.api.nvim_buf_delete(buf.bufnr, { force = true })
3939
if not view.View.float.quit_on_focus_loss then
@@ -62,7 +62,7 @@ local function remove_dir(cwd)
6262
break
6363
end
6464

65-
local new_cwd = utils.path_join { cwd, name }
65+
local new_cwd = utils.path_join({ cwd, name })
6666
if t == "directory" then
6767
local success = remove_dir(new_cwd)
6868
if not success then

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

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
local core = require "nvim-tree.core"
2-
local lib = require "nvim-tree.lib"
3-
local utils = require "nvim-tree.utils"
4-
local events = require "nvim-tree.events"
5-
local notify = require "nvim-tree.notify"
1+
local core = require("nvim-tree.core")
2+
local lib = require("nvim-tree.lib")
3+
local utils = require("nvim-tree.utils")
4+
local events = require("nvim-tree.events")
5+
local notify = require("nvim-tree.notify")
66

77
local find_file = require("nvim-tree.actions.finders.find-file").fn
88

@@ -64,10 +64,10 @@ function M.rename(node, to)
6464
idx = idx + 1
6565

6666
local p = utils.path_remove_trailing(path)
67-
if #path_to_create == 0 and vim.fn.has "win32" == 1 then
68-
path_to_create = utils.path_join { p, path_to_create }
67+
if #path_to_create == 0 and vim.fn.has("win32") == 1 then
68+
path_to_create = utils.path_join({ p, path_to_create })
6969
else
70-
path_to_create = utils.path_join { path_to_create, p }
70+
path_to_create = utils.path_join({ path_to_create, p })
7171
end
7272

7373
if idx == num_nodes then

lua/nvim-tree/actions/fs/trash.lua

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
local core = require "nvim-tree.core"
2-
local lib = require "nvim-tree.lib"
3-
local notify = require "nvim-tree.notify"
1+
local core = require("nvim-tree.core")
2+
local lib = require("nvim-tree.lib")
3+
local notify = require("nvim-tree.notify")
44

55
local M = {
66
config = {},
77
}
88

9-
local utils = require "nvim-tree.utils"
10-
local events = require "nvim-tree.events"
9+
local utils = require("nvim-tree.utils")
10+
local events = require("nvim-tree.events")
1111

1212
---@param absolute_path string
1313
local function clear_buffer(absolute_path)
14-
local bufs = vim.fn.getbufinfo { bufloaded = 1, buflisted = 1 }
14+
local bufs = vim.fn.getbufinfo({ bufloaded = 1, buflisted = 1 })
1515
for _, buf in pairs(bufs) do
1616
if buf.name == absolute_path then
1717
if buf.hidden == 0 and #bufs > 1 then
1818
local winnr = vim.api.nvim_get_current_win()
1919
vim.api.nvim_set_current_win(buf.windows[1])
20-
vim.cmd ":bn"
20+
vim.cmd(":bn")
2121
vim.api.nvim_set_current_win(winnr)
2222
end
2323
vim.api.nvim_buf_delete(buf.bufnr, {})
@@ -48,7 +48,7 @@ function M.remove(node)
4848
on_stderr = on_stderr,
4949
})
5050
if need_sync_wait then
51-
vim.fn.jobwait { job }
51+
vim.fn.jobwait({ job })
5252
end
5353
end
5454

lua/nvim-tree/actions/init.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
local M = {}
22

3-
M.finders = require "nvim-tree.actions.finders"
4-
M.fs = require "nvim-tree.actions.fs"
5-
M.moves = require "nvim-tree.actions.moves"
6-
M.node = require "nvim-tree.actions.node"
7-
M.root = require "nvim-tree.actions.root"
8-
M.tree = require "nvim-tree.actions.tree"
3+
M.finders = require("nvim-tree.actions.finders")
4+
M.fs = require("nvim-tree.actions.fs")
5+
M.moves = require("nvim-tree.actions.moves")
6+
M.node = require("nvim-tree.actions.node")
7+
M.root = require("nvim-tree.actions.root")
8+
M.tree = require("nvim-tree.actions.tree")
99

1010
function M.setup(opts)
1111
M.fs.setup(opts)

lua/nvim-tree/actions/moves/init.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
local M = {}
22

3-
M.item = require "nvim-tree.actions.moves.item"
4-
M.parent = require "nvim-tree.actions.moves.parent"
5-
M.sibling = require "nvim-tree.actions.moves.sibling"
3+
M.item = require("nvim-tree.actions.moves.item")
4+
M.parent = require("nvim-tree.actions.moves.parent")
5+
M.sibling = require("nvim-tree.actions.moves.sibling")
66

77
return M

0 commit comments

Comments
 (0)