Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- main
- v1.x
- v2.x
- v3.x
pull_request:
branches:
- main
Expand All @@ -16,11 +17,11 @@ jobs:
- uses: actions/checkout@v1

- name: Check formatting
uses: JohnnyMorganz/stylua-action@1.0.0
uses: JohnnyMorganz/stylua-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: v0.13.1
args: --color always --check lua/
version: v0.15.2
args: --color always --check -g '!**/defaults.lua' lua/

plenary-tests:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -54,6 +55,7 @@ jobs:
with:
path: ~/.local/share/luver
key: ${{ steps.luver-cache-key.outputs.value }}

- name: Setup Lua
uses: MunifTanjim/luver-action@v1
with:
Expand Down
7 changes: 2 additions & 5 deletions lua/neo-tree/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,8 @@ end
log.new = function(config, standalone)
config = vim.tbl_deep_extend("force", default_config, config)

local outfile = string.format(
"%s/%s.log",
vim.api.nvim_call_function("stdpath", { "data" }),
config.plugin
)
local outfile =
string.format("%s/%s.log", vim.api.nvim_call_function("stdpath", { "data" }), config.plugin)

local obj
if standalone then
Expand Down
15 changes: 4 additions & 11 deletions lua/neo-tree/setup/deprecations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ M.migrate = function(config)
end
utils.set_value(config, new, exising)
config[old] = nil
migrations[#migrations + 1] = string.format(
"The `%s` option has been deprecated, please use `%s` instead.",
old,
new
)
migrations[#migrations + 1] =
string.format("The `%s` option has been deprecated, please use `%s` instead.", old, new)
end
end

Expand All @@ -61,12 +58,8 @@ M.migrate = function(config)
local value = utils.get_value(config, key)
if value == old_value then
utils.set_value(config, key, new_value)
migrations[#migrations + 1] = string.format(
"The `%s=%s` option has been renamed to `%s`.",
key,
old_value,
new_value
)
migrations[#migrations + 1] =
string.format("The `%s=%s` option has been renamed to `%s`.", key, old_value, new_value)
end
end

Expand Down
60 changes: 29 additions & 31 deletions lua/neo-tree/sources/filesystem/lib/filter_external.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,40 +138,38 @@ M.find_files = function(opts)
end
local item_count = 0
local over_limit = false
Job
:new({
command = cmd,
cwd = path,
args = args,
enable_recording = false,
on_stdout = function(err, line)
if not over_limit then
if opts.on_insert then
opts.on_insert(err, line)
end
item_count = item_count + 1
over_limit = maximum_results and item_count > maximum_results
Job:new({
command = cmd,
cwd = path,
args = args,
enable_recording = false,
on_stdout = function(err, line)
if not over_limit then
if opts.on_insert then
opts.on_insert(err, line)
end
end,
on_stderr = function(err, line)
if not over_limit then
if opts.on_insert then
if not err then
err = line
end
opts.on_insert(err, line)
item_count = item_count + 1
over_limit = maximum_results and item_count > maximum_results
end
end,
on_stderr = function(err, line)
if not over_limit then
if opts.on_insert then
if not err then
err = line
end
item_count = item_count + 1
over_limit = maximum_results and item_count > maximum_results
end
end,
on_exit = function(_, return_val)
if opts.on_exit then
opts.on_exit(return_val)
opts.on_insert(err, line)
end
end,
})
:start()
item_count = item_count + 1
over_limit = maximum_results and item_count > maximum_results
end
end,
on_exit = function(_, return_val)
if opts.on_exit then
opts.on_exit(return_val)
end
end,
}):start()
end

return M
16 changes: 4 additions & 12 deletions lua/neo-tree/ui/highlights.lua
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,8 @@ M.get_faded_highlight_group = function(hl_group_name, fade_percentage)
local green = (f_green * fade_percentage) + (b_green * (1 - fade_percentage))
local blue = (f_blue * fade_percentage) + (b_blue * (1 - fade_percentage))

local new_foreground = string.format(
"%s%s%s",
dec_to_hex(red, 2),
dec_to_hex(green, 2),
dec_to_hex(blue, 2)
)
local new_foreground =
string.format("%s%s%s", dec_to_hex(red, 2), dec_to_hex(green, 2), dec_to_hex(blue, 2))

M.create_highlight_group(key, {}, hl_group.background, new_foreground, gui)
faded_highlight_group_cache[key] = key
Expand All @@ -220,12 +216,8 @@ M.setup = function()

M.create_highlight_group(M.END_OF_BUFFER, { "EndOfBuffer" })

local float_border_hl = M.create_highlight_group(
M.FLOAT_BORDER,
{ "FloatBorder" },
normalnc_hl.background,
"444444"
)
local float_border_hl =
M.create_highlight_group(M.FLOAT_BORDER, { "FloatBorder" }, normalnc_hl.background, "444444")

M.create_highlight_group(M.FLOAT_TITLE, {}, float_border_hl.background, normal_hl.foreground)

Expand Down
17 changes: 4 additions & 13 deletions lua/neo-tree/ui/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -284,13 +284,8 @@ end
M.render_component = function(component, item, state, remaining_width)
local component_func = state.components[component[1]]
if component_func then
local success, component_data, wanted_width = pcall(
component_func,
component,
item,
state,
remaining_width
)
local success, component_data, wanted_width =
pcall(component_func, component, item, state, remaining_width)
if success then
if component_data == nil then
return { {} }
Expand Down Expand Up @@ -361,12 +356,8 @@ local prepare_node = function(item, state)
remaining_cols = math.min(remaining_cols, longest + 4)
end
for _, component in ipairs(renderer) do
local component_data, component_wanted_width = M.render_component(
component,
item,
state,
remaining_cols
)
local component_data, component_wanted_width =
M.render_component(component, item, state, remaining_cols)
local actual_width = 0
if component_data then
for _, data in ipairs(component_data) do
Expand Down
7 changes: 2 additions & 5 deletions lua/neo-tree/ui/selector.lua
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,8 @@ M.get = function()
return
else
local config = require("neo-tree").config
local scrolled_off = utils.resolve_config_option(
config,
"source_selector.show_scrolled_off_parent_node",
false
)
local scrolled_off =
utils.resolve_config_option(config, "source_selector.show_scrolled_off_parent_node", false)
if scrolled_off then
local node_text = M.get_scrolled_off_node_text(state)
if node_text ~= nil then
Expand Down