chore(#2931): stylua -> EmmyLuaCodeStyle (#2932)

* stylua -> EmmyLuaCodeStyle: config and doc

* stylua -> EmmyLuaCodeStyle: CI

* stylua -> EmmyLuaCodeStyle: CI

* stylua -> EmmyLuaCodeStyle: CI

* stylua -> EmmyLuaCodeStyle: CI

* stylua -> EmmyLuaCodeStyle: CI

* stylua -> EmmyLuaCodeStyle

* stylua -> EmmyLuaCodeStyle: call_arg_parentheses = always

* stylua -> EmmyLuaCodeStyle

* stylua -> EmmyLuaCodeStyle
This commit is contained in:
Alexander Courtis
2024-09-29 14:05:52 +10:00
committed by GitHub
parent 9650e735ba
commit 1ae1c33ce1
80 changed files with 590 additions and 583 deletions

View File

@@ -1,4 +1,4 @@
local utils = require "nvim-tree.utils"
local utils = require("nvim-tree.utils")
local FILTER_REASON = require("nvim-tree.enum").FILTER_REASON
---@class Filters to handle all opts.filters and related API
@@ -165,7 +165,7 @@ local function custom(self, path)
end
end
local idx = path:match ".+()%.[^.]+$"
local idx = path:match(".+()%.[^.]+$")
if idx then
if self.ignore_list["*" .. string.sub(path, idx)] == true then
return true
@@ -189,7 +189,7 @@ function Filters:prepare(git_status)
}
if self.config.filter_no_buffer then
status.bufinfo = vim.fn.getbufinfo { buflisted = 1 }
status.bufinfo = vim.fn.getbufinfo({ buflisted = 1 })
end
local explorer = require("nvim-tree.core").get_explorer()

View File

@@ -1,22 +1,22 @@
local builders = require "nvim-tree.explorer.node-builders"
local git = require "nvim-tree.git"
local log = require "nvim-tree.log"
local notify = require "nvim-tree.notify"
local utils = require "nvim-tree.utils"
local view = require "nvim-tree.view"
local watch = require "nvim-tree.explorer.watch"
local explorer_node = require "nvim-tree.explorer.node"
local builders = require("nvim-tree.explorer.node-builders")
local git = require("nvim-tree.git")
local log = require("nvim-tree.log")
local notify = require("nvim-tree.notify")
local utils = require("nvim-tree.utils")
local view = require("nvim-tree.view")
local watch = require("nvim-tree.explorer.watch")
local explorer_node = require("nvim-tree.explorer.node")
local Iterator = require "nvim-tree.iterators.node-iterator"
local NodeIterator = require "nvim-tree.iterators.node-iterator"
local Watcher = require "nvim-tree.watcher"
local Iterator = require("nvim-tree.iterators.node-iterator")
local NodeIterator = require("nvim-tree.iterators.node-iterator")
local Watcher = require("nvim-tree.watcher")
local Filters = require "nvim-tree.explorer.filters"
local Marks = require "nvim-tree.marks"
local LiveFilter = require "nvim-tree.explorer.live-filter"
local Sorters = require "nvim-tree.explorer.sorters"
local Clipboard = require "nvim-tree.actions.fs.clipboard"
local Renderer = require "nvim-tree.renderer"
local Filters = require("nvim-tree.explorer.filters")
local Marks = require("nvim-tree.marks")
local LiveFilter = require("nvim-tree.explorer.live-filter")
local Sorters = require("nvim-tree.explorer.sorters")
local Clipboard = require("nvim-tree.actions.fs.clipboard")
local Renderer = require("nvim-tree.renderer")
local FILTER_REASON = require("nvim-tree.enum").FILTER_REASON
@@ -130,7 +130,7 @@ function Explorer:reload(node, git_status)
break
end
local abs = utils.path_join { cwd, name }
local abs = utils.path_join({ cwd, name })
---@type uv.fs_stat.result|nil
local stat = vim.loop.fs_lstat(abs)
@@ -359,7 +359,7 @@ function Explorer:populate_children(handle, cwd, node, git_status, parent)
break
end
local abs = utils.path_join { cwd, name }
local abs = utils.path_join({ cwd, name })
if Watcher.is_fs_event_capable(abs) then
local profile = log.profile_start("populate_children %s", abs)

View File

@@ -1,6 +1,6 @@
local view = require "nvim-tree.view"
local utils = require "nvim-tree.utils"
local Iterator = require "nvim-tree.iterators.node-iterator"
local view = require("nvim-tree.view")
local utils = require("nvim-tree.utils")
local Iterator = require("nvim-tree.iterators.node-iterator")
---@class LiveFilter
---@field explorer Explorer
@@ -162,11 +162,11 @@ end
local function create_overlay(self)
if view.View.float.enable then
-- don't close nvim-tree float when focus is changed to filter window
vim.api.nvim_clear_autocmds {
vim.api.nvim_clear_autocmds({
event = "WinLeave",
pattern = "NvimTree_*",
group = vim.api.nvim_create_augroup("NvimTree", { clear = false }),
}
})
end
configure_buffer_overlay(self)
@@ -180,14 +180,14 @@ local function create_overlay(self)
style = "minimal",
})
if vim.fn.has "nvim-0.10" == 1 then
if vim.fn.has("nvim-0.10") == 1 then
vim.api.nvim_set_option_value("modifiable", true, { buf = overlay_bufnr })
else
vim.api.nvim_buf_set_option(overlay_bufnr, "modifiable", true) ---@diagnostic disable-line: deprecated
end
vim.api.nvim_buf_set_lines(overlay_bufnr, 0, -1, false, { self.filter })
vim.cmd "startinsert"
vim.cmd("startinsert")
vim.api.nvim_win_set_cursor(overlay_winnr, { 1, #self.filter + 1 })
end
@@ -198,7 +198,7 @@ function LiveFilter:start_filtering()
self.explorer.renderer:draw()
local row = require("nvim-tree.core").get_nodes_starting_line() - 1
local col = #self.prefix > 0 and #self.prefix - 1 or 1
view.set_cursor { row, col }
view.set_cursor({ row, col })
-- needs scheduling to let the cursor move before initializing the window
vim.schedule(function()
return create_overlay(self)

View File

@@ -1,5 +1,5 @@
local utils = require "nvim-tree.utils"
local watch = require "nvim-tree.explorer.watch"
local utils = require("nvim-tree.utils")
local watch = require("nvim-tree.explorer.watch")
local M = {}

View File

@@ -177,7 +177,7 @@ function M.setup(opts)
git = opts.git,
}
git = require "nvim-tree.git"
git = require("nvim-tree.git")
end
return M

View File

@@ -122,7 +122,7 @@ function Sorter:sort(t)
absolute_path = n.absolute_path,
executable = n.executable,
extension = n.extension,
filetype = vim.filetype.match { filename = n.name },
filetype = vim.filetype.match({ filename = n.name }),
link_to = n.link_to,
name = n.name,
type = n.type,
@@ -237,8 +237,8 @@ function C.suffix(a, b, cfg)
end
-- unsuffixed go third
local a_suffix_ndx = a.name:find "%.%w+$"
local b_suffix_ndx = b.name:find "%.%w+$"
local a_suffix_ndx = a.name:find("%.%w+$")
local b_suffix_ndx = b.name:find("%.%w+$")
if not a_suffix_ndx and b_suffix_ndx then
return true
@@ -289,8 +289,8 @@ function C.extension(a, b, cfg)
end
function C.filetype(a, b, cfg)
local a_ft = vim.filetype.match { filename = a.name }
local b_ft = vim.filetype.match { filename = b.name }
local a_ft = vim.filetype.match({ filename = a.name })
local b_ft = vim.filetype.match({ filename = b.name })
-- directories first
local early_return = folders_or_files_first(a, b, cfg)

View File

@@ -1,5 +1,5 @@
local log = require "nvim-tree.log"
local utils = require "nvim-tree.utils"
local log = require("nvim-tree.log")
local utils = require("nvim-tree.utils")
local Watcher = require("nvim-tree.watcher").Watcher
local M = {