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
74 changes: 37 additions & 37 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@ name: CI
on:
push:
branches:
- main
- v1.x
- v2.x
- v3.x
- main
- v1.x
- v2.x
- v3.x
pull_request:
branches:
- main
- main

jobs:
stylua-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v1

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

plenary-tests:
runs-on: ubuntu-20.04
Expand All @@ -43,33 +43,33 @@ jobs:
mv nvim.appimage ./build/nvim
}

- name: Get Luver Cache Key
id: luver-cache-key
env:
CI_RUNNER_OS: ${{ runner.os }}
run: |
echo "::set-output name=value::${CI_RUNNER_OS}-luver-v1-$(date -u +%Y-%m-%d)"
shell: bash
- name: Setup Luver Cache
uses: actions/cache@v2
with:
path: ~/.local/share/luver
key: ${{ steps.luver-cache-key.outputs.value }}
# - name: Get Luver Cache Key
# id: luver-cache-key
# env:
# CI_RUNNER_OS: ${{ runner.os }}
# run: |
# echo "::set-output name=value::${CI_RUNNER_OS}-luver-v1-$(date -u +%Y-%m-%d)"
# shell: bash
# - name: Setup Luver Cache
# uses: actions/cache@v2
# with:
# path: ~/.local/share/luver
# key: ${{ steps.luver-cache-key.outputs.value }}

- name: Setup Lua
uses: MunifTanjim/luver-action@v1
with:
default: 5.1.5
lua_versions: 5.1.5
luarocks_versions: 5.1.5:3.8.0
- name: Setup luacov
run: |
luarocks install luacov
# - name: Setup Lua
# uses: MunifTanjim/luver-action@v1
# with:
# default: 5.1.5
# lua_versions: 5.1.5
# luarocks_versions: 5.1.5:3.8.0
# - name: Setup luacov
# run: |
# luarocks install luacov

- name: Run tests
run: |
export PATH="${PWD}/build/:${PATH}"
./scripts/test.sh
export PATH="${PWD}/build/:${PATH}"
./scripts/test.sh

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v2
6 changes: 3 additions & 3 deletions lua/neo-tree/sources/common/components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ M.name = function(config, node, state)
end
end

if node:get_depth() == 1 then
if node:get_depth() == 1 and node.type ~= "message" then
highlight = highlights.ROOT_NAME
else
local filtered_by = M.filtered_by(config, node, state)
Expand Down Expand Up @@ -353,14 +353,14 @@ M.indent = function(config, node, state)
local level = node.level
local with_markers = config.with_markers
local with_expanders = config.with_expanders == nil and file_nesting.is_enabled()
or config.with_expanders
or config.with_expanders
local marker_highlight = config.highlight or highlights.INDENT_MARKER
local expander_highlight = config.expander_highlight or config.highlight or highlights.EXPANDER

local function get_expander()
if with_expanders and utils.is_expandable(node) then
return node:is_expanded() and (config.expander_expanded or "")
or (config.expander_collapsed or "")
or (config.expander_collapsed or "")
end
end

Expand Down
9 changes: 8 additions & 1 deletion lua/neo-tree/sources/filesystem/lib/fs_scan.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ local render_context = function(context)
end
fs_watch.updated_watched()

file_items.deep_sort(root.children)
if root and root.children then
file_items.deep_sort(root.children)
end
if parent_id then
-- lazy loading a child folder
renderer.show_nodes(root.children, state, parent_id, context.callback)
Expand All @@ -106,6 +108,11 @@ end
local job_complete = function(context)
local state = context.state
local parent_id = context.parent_id
if #context.all_items == 0 then
log.info("No items, skipping git ignored/status lookups")
render_context(context)
return
end
if state.filtered_items.hide_gitignored or state.enable_git_status then
if require("neo-tree").config.git_status_async then
git.mark_ignored(state, context.all_items, function(all_items)
Expand Down
17 changes: 17 additions & 0 deletions lua/neo-tree/ui/renderer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ M.show_nodes = function(sourceItems, state, parentId, callback)
--local id = string.format("show_nodes %s:%s [%s]", state.name, state.force_float, state.tabnr)
--utils.debounce(id, function()
events.fire_event(events.BEFORE_RENDER, state)
local is_empty_with_hidden_root = false
state.longest_width_exact = 0
local parent
local level = 0
Expand All @@ -1092,6 +1093,11 @@ M.show_nodes = function(sourceItems, state, parentId, callback)
if config.hide_root_node then
if not parentId then
sourceItems[1].skip_node = true
if sourceItems[1].children and #sourceItems[1].children > 0 then
is_empty_with_hidden_root = false
else
is_empty_with_hidden_root = true
end
end
if not config.retain_hidden_root_indent then
level = level - 1
Expand Down Expand Up @@ -1150,6 +1156,17 @@ M.show_nodes = function(sourceItems, state, parentId, callback)
if sourceItems then
-- normal path
local nodes = create_nodes(sourceItems, state, level)
if is_empty_with_hidden_root then
local nodeData = {
id = state.path .. "_empty_message",
name = "(empty folder)",
type = "message",
level = 0,
is_last_child = true,
}
local node = NuiTree.Node(nodeData, {})
table.insert(nodes, node)
end
draw(nodes, state, parentId)
else
-- this was a force grouping of a lazy loaded folder
Expand Down
6 changes: 3 additions & 3 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function setup_environment() {
echo "[plugins] plenary.nvim: installing..."
git clone https://github.com/nvim-lua/plenary.nvim "${plugins_dir}/plenary.nvim"
# this commit broke luacov
git -C "${plugins_dir}/plenary.nvim" revert --no-commit 9069d14a120cadb4f6825f76821533f2babcab92
#git -C "${plugins_dir}/plenary.nvim" revert --no-commit 9069d14a120cadb4f6825f76821533f2babcab92
echo "[plugins] plenary.nvim: installed"
echo
fi
Expand Down Expand Up @@ -78,8 +78,8 @@ function luacov_end() {

setup_environment

luacov_start
#luacov_start

make test

luacov_end
#luacov_end