Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
155 commits
Select commit Hold shift + click to select a range
0abb417
test: neovim functional test integration and example test
alex-courtis Sep 8, 2026
a59bb66
test: add luals library for functionaltest framework
alex-courtis Sep 8, 2026
ada6337
test: add NvimTree* hl group handling to functionaltest
alex-courtis Sep 8, 2026
aa84f4a
test: add luals library for functionaltest framework
alex-courtis Sep 9, 2026
12610d6
test: create unique NvimTree HL group definitions
alex-courtis Sep 10, 2026
117169f
test: create unique NvimTree HL group definitions
alex-courtis Sep 10, 2026
db732e6
test: refactor functional test lifecycle, add another test
alex-courtis Sep 10, 2026
5a8deb1
test: simplify package loading
alex-courtis Sep 10, 2026
9b7c91e
test: add text-only functional test
alex-courtis Sep 11, 2026
6c235bd
test: Screen 80 x 25 for more deterministic window sizes
alex-courtis Sep 11, 2026
92ef8ff
test: Screen 80 x 25 for more deterministic window sizes
alex-courtis Sep 11, 2026
3aaeb42
test: somewhat idempotent nvt_hl_attr_ids called in before_each
alex-courtis Sep 11, 2026
5a35843
test: add an interactive node open test
alex-courtis Sep 11, 2026
05761a1
test: Screen 80 x 24 for more deterministic window sizes
alex-courtis Sep 11, 2026
7e03da7
test: purge state clears cursor positions
alex-courtis Sep 11, 2026
6065099
test: functionaltest.sh driver allows test selection
alex-courtis Sep 14, 2026
2b89e2d
test: func tests use fixed contents data directories
alex-courtis Sep 14, 2026
f46f5e5
test: add functional test live for creating test data
alex-courtis Sep 14, 2026
e4bd4e4
test: add live test capture functionality
alex-courtis Sep 15, 2026
3b64efe
test: add live test capture functionality
alex-courtis Sep 15, 2026
9595cf4
test: add live test capture functionality
alex-courtis Sep 15, 2026
4af24cf
test: add live test capture functionality
alex-courtis Sep 15, 2026
d4aca2f
test: add live test capture functionality
alex-courtis Sep 16, 2026
cdace03
test: add root dir to tests
alex-courtis Sep 16, 2026
2586175
test: document highlight group testing
alex-courtis Sep 16, 2026
f5da3bb
test: add fs/create/dir
alex-courtis Sep 16, 2026
1669c2c
test: clearer func temp directories
alex-courtis Sep 17, 2026
6ae3b96
test: live_dump no longer global
alex-courtis Sep 17, 2026
fd0041f
test: optionally collapse screen dumps
alex-courtis Sep 17, 2026
4ed7c2d
test: add test/ to lint and style
alex-courtis Sep 18, 2026
6bf2573
test: extract common scripts/check-nvim-src.sh
alex-courtis Sep 18, 2026
8d17bc5
test: add functionaltest ci job
alex-courtis Sep 18, 2026
5938938
test: ensure no empty directories in func test data
alex-courtis Sep 18, 2026
b02c09c
test: run functest against nightly
alex-courtis Sep 18, 2026
59ee8cd
test: stable and nightly test compatibility
alex-courtis Sep 18, 2026
cda1708
test: luals-check for functests
alex-courtis Sep 18, 2026
cb2ded9
test: luals-check uses neovim source runtime
alex-courtis Sep 18, 2026
4652dcc
test: add luals for functest
alex-courtis Sep 18, 2026
3524a7b
test: stable and nightly test compatibility
alex-courtis Sep 18, 2026
e4eb59e
Merge branch 'master' into test-neovim-functionaltest
alex-courtis Sep 21, 2026
76aa4db
test: func tests are responsible for setting up and tearing down data
alex-courtis Sep 21, 2026
8e2de73
test: link test and lua separately under nvim src
alex-courtis Sep 22, 2026
d3854eb
test: link test and lua separately under nvim src
alex-courtis Sep 22, 2026
d4d0228
test: extract testutil.lua
alex-courtis Sep 22, 2026
56fb235
test: extract fixtures.lua
alex-courtis Sep 22, 2026
1c8a4cc
test: extract fixtures.lua
alex-courtis Sep 22, 2026
270f8c2
test: shell script is responsible for creating test directory
alex-courtis Sep 23, 2026
3f955e5
test: shell script is responsible for creating test directory
alex-courtis Sep 23, 2026
8b74f72
test: shell script is responsible for creating test directory
alex-courtis Sep 23, 2026
e9273e5
test: complete functionaltest.sh script
alex-courtis Sep 24, 2026
0debfb9
test: complete functionaltest.sh script
alex-courtis Sep 24, 2026
6ed1d4f
test: complete functionaltest.sh script
alex-courtis Sep 24, 2026
2fe87ab
test: extract utils
alex-courtis Sep 24, 2026
26256c4
test: more dir tests
alex-courtis Sep 24, 2026
a80f708
test: extract fixtures, remove utils
alex-courtis Sep 24, 2026
81778d6
test: more dir create tests, add file create tests
alex-courtis Sep 24, 2026
a712128
test: add event tests, implement for dirs
alex-courtis Sep 25, 2026
e722e8a
test: file event tests
alex-courtis Sep 25, 2026
3da23d2
test: illegal location create tests
alex-courtis Sep 25, 2026
6115910
test: lint/style
alex-courtis Sep 25, 2026
ee7c259
test: lint/style
alex-courtis Sep 25, 2026
f881f27
test: always teardown on functest failures to prevent luals picking u…
alex-courtis Sep 25, 2026
3f63e58
test: run all requested functests, exiting with number of failrues
alex-courtis Sep 28, 2026
d92b79b
test: inject test failures to test CI
alex-courtis Sep 28, 2026
1e7cdc5
Revert "test: inject test failures to test CI"
alex-courtis Sep 28, 2026
ef2263b
test: include nvim-tree source in test plumbing
alex-courtis Sep 28, 2026
3c4d3fe
test: use appearance source to simplify highlight groups
alex-courtis Sep 28, 2026
9a94bb7
test: revert commented test
alex-courtis Sep 28, 2026
464ab53
test: add nvim-tree source to test lpath, remove links
alex-courtis Sep 28, 2026
c53ab9b
test: func test runs from a single link under nvim src
alex-courtis Sep 29, 2026
8720dc4
test: func test package is the nvim-tree source link itself
alex-courtis Sep 29, 2026
b1e088b
test: func test package is the nvim-tree source link itself
alex-courtis Sep 29, 2026
febbaf1
test: proper namespace for nvt tests
alex-courtis Sep 29, 2026
6001518
test: proper namespace for nvt tests
alex-courtis Sep 29, 2026
a70586e
test: add events_clear
alex-courtis Sep 29, 2026
0e48695
test: more fs.create.dir tests
alex-courtis Sep 30, 2026
c7b6e29
test: functionaltest.sh -l operates on any file or dir, finding data …
alex-courtis Sep 30, 2026
559f07f
test: more fs.create.dir tests
alex-courtis Sep 30, 2026
47fed8b
doc: fix incorrect register doc for actions.use_system_clipboard
alex-courtis Sep 30, 2026
178c640
test: add func fs.copy.node
alex-courtis Sep 30, 2026
5287d4b
test: add func fs.copy.node
alex-courtis Sep 30, 2026
adb2185
doc: fix incorrect register doc for actions.use_system_clipboard
alex-courtis Sep 30, 2026
540cb4c
test: add func fs.copy.node
alex-courtis Sep 30, 2026
df9f60e
test: add func fs.copy.node
alex-courtis Sep 30, 2026
2a3638b
test: add func fs.copy.node
alex-courtis Sep 30, 2026
de1606c
test: add screen width/height params
alex-courtis Sep 30, 2026
cc39375
test: add dummy clipboard fixture
alex-courtis Oct 1, 2026
77486e7
test: add dummy clipboard fixture
alex-courtis Oct 1, 2026
dd56f8e
test: remove poc test
alex-courtis Oct 2, 2026
0691a1d
test: don't use ext_linegrid when expecting HL groups for performance…
alex-courtis Oct 2, 2026
2f2bde5
test: remove poc test
alex-courtis Oct 2, 2026
abb4655
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
014a2eb
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
a9aaa82
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
1b3a1ff
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
197699c
test: create_sessions now calls setup and adds attr_ids
alex-courtis Oct 2, 2026
30b5e07
test: organise copy structure nicely
alex-courtis Oct 2, 2026
a667003
test: organise fs.create structure nicely
alex-courtis Oct 2, 2026
90ee602
test: add fs/cut
alex-courtis Oct 5, 2026
4c49ec9
test: add fs cut override copy
alex-courtis Oct 5, 2026
7484914
test: add fs copy override cut
alex-courtis Oct 5, 2026
40e5cb3
test: add fs print_clipboard
alex-courtis Oct 5, 2026
20c92ca
test: add fs print_clipboard
alex-courtis Oct 5, 2026
d60f2a2
test: normalise names, use functional area as describe
alex-courtis Oct 5, 2026
95118fc
test: add fs.paste, wip
alex-courtis Oct 6, 2026
9ede3f8
test: fs.paste, wip
alex-courtis Oct 6, 2026
a5ba067
test: fs.paste cut tests buffer moved
alex-courtis Oct 6, 2026
ccae550
test: fs.paste API tests
alex-courtis Oct 7, 2026
7ee7ae3
test: remove TODO from BUGs
alex-courtis Oct 8, 2026
46c3302
test: cut_spec uses internal API pending resolution of #3362
alex-courtis Oct 8, 2026
7220d22
test: paste multiple copied
alex-courtis Oct 9, 2026
e72af3e
test: copied_spec uses synchronous tree calls
alex-courtis Oct 9, 2026
da165eb
Revert "test: copied_spec uses synchronous tree calls"
alex-courtis Oct 12, 2026
5453abd
test: use poke_eventloop to snc fs/paste tests, needs a better solution
alex-courtis Oct 12, 2026
f619d99
test: add utils with feed_sync, needs migration for all tests
alex-courtis Oct 13, 2026
d108dda
test: use feed_sync for all functests
alex-courtis Oct 13, 2026
d242988
test: fs.create prompt timing fixes
alex-courtis Oct 13, 2026
276d20d
test: namespace functionaltest methods so that 0.12 global compatibil…
alex-courtis Oct 13, 2026
69a6a2a
test: namespace functionaltest methods so that 0.12 global compatibil…
alex-courtis Oct 13, 2026
1331b8d
test: add missing API test variants
alex-courtis Oct 13, 2026
f797b01
Revert "test: namespace functionaltest methods so that 0.12 global co…
alex-courtis Oct 13, 2026
97920d7
Revert "test: namespace functionaltest methods so that 0.12 global co…
alex-courtis Oct 13, 2026
24102fb
test: add multiple paste tests
alex-courtis Oct 13, 2026
3830776
test: add multiple paste tests
alex-courtis Oct 13, 2026
2e3e69c
test: add fs.clear_clipboard tests
alex-courtis Oct 14, 2026
cc5ce95
test: formatting
alex-courtis Oct 14, 2026
0c40e11
test: add fs.move tests
alex-courtis Oct 14, 2026
57ca2e0
test: formatting
alex-courtis Oct 14, 2026
b563d90
test: add fs.trash tests, wip
alex-courtis Oct 14, 2026
53aa644
test: add buf_exists asserts, fs.trash tests, wip
alex-courtis Oct 14, 2026
72c61f6
test: fs.trash tests, wip
alex-courtis Oct 14, 2026
5863439
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
b188f99
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
5ddb6f6
test: tidy any unnecessary ext_cmdline
alex-courtis Oct 15, 2026
e103c52
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
71df054
Revert "test: fs.trash tests, wip"
alex-courtis Oct 15, 2026
8e9041b
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
78aaae7
test: notes on func test ext_cmdline and ext_messages
alex-courtis Oct 15, 2026
ead37d8
test: print/clear clipboard use ext_messages
alex-courtis Oct 15, 2026
c4f662a
test: add missing file create message assertions, add functest global…
alex-courtis Oct 15, 2026
a802911
test: namespace functionaltest methods so that 0.12 global compatibil…
alex-courtis Oct 15, 2026
2611540
test: notes on test mechanisms
alex-courtis Oct 15, 2026
ea3ea20
test: notes on test assertions
alex-courtis Oct 15, 2026
0c6e959
test: notes on test timeouts
alex-courtis Oct 15, 2026
b5ea788
test: notes on test timeouts
alex-courtis Oct 15, 2026
4e8e0d3
test: experiment, disable feed_sync poke to see CI test output
alex-courtis Oct 15, 2026
ed7ea49
Revert "test: experiment, disable feed_sync poke to see CI test output"
alex-courtis Oct 15, 2026
d8f5ee9
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
f166e8a
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
60bdaa9
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
9b2dba6
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
859f649
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
35087f9
test: each functest passes its own data dir
alex-courtis Oct 18, 2026
c824e52
test: copy data directory from source, enable live, allow dirs other …
alex-courtis Oct 19, 2026
e69b7f7
test: execute all test in one call to make functionaltest
alex-courtis Oct 19, 2026
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
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,42 @@ jobs:

- run: make help-check
if: ${{ matrix.nvim_version == 'stable' }}

functionaltest:
runs-on: ubuntu-latest

concurrency:
group: ${{ github.workflow }}-${{ matrix.nvim_version }}-${{ matrix.luals_version }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

strategy:
matrix:
nvim_version: [ stable, nightly ]
luals_version: [ 3.15.0 ]

env:
VIMRUNTIME: /home/runner/nvim-${{ matrix.nvim_version }}/share/nvim/runtime
DIR_NVIM_SRC: /home/runner/src/neovim-${{ matrix.nvim_version }}

steps:
- name: checkout
uses: actions/checkout@v7

- name: install lua-language-server ${{ matrix.luals_version }}
run: |
mkdir -p luals
curl -L "https://github.com/LuaLS/lua-language-server/releases/download/${{ matrix.luals_version }}/lua-language-server-${{ matrix.luals_version }}-linux-x64.tar.gz" | tar zx --directory luals
echo "luals/bin" >> "$GITHUB_PATH"

- name: build Nvim from source
run: |
mkdir -p "${DIR_NVIM_SRC}"
curl -L "https://github.com/neovim/neovim/archive/refs/tags/${{ matrix.nvim_version }}.tar.gz" | tar zx --directory "${DIR_NVIM_SRC}/.."
cd "${DIR_NVIM_SRC}"
make

- run: scripts/functionaltest.sh -a

- run: scripts/luals-check.sh test

- run: scripts/luals-check.sh codestyle-check test
17 changes: 15 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ local M = {}
M.self = false

M.ignore = {
"631", -- max_line_length
"631", -- max_line_length
}

-- Global objects defined by the C code
M.globals = {
-- Global objects defined by the C code
"vim",
-- Global neovim test functions
"it",
"describe",
"pending",
"setup",
"before_each",
"after_each",
"teardown",
"finally",
-- Global nvt functiontest fixtures
"NVT_FUNCTEST_CONTEXT",
"NVT_FUNCTEST_EVENTS",
"NVT_FUNCTEST_CLIPBOARD_LINES",
}

return M
10 changes: 8 additions & 2 deletions .luarc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"workspace": {
"library": [
"$VIMRUNTIME/lua/vim",
"${3rd}/luv/library"
"${3rd}/luv/library",
"$DIR_NVIM_SRC/test",
"/tmp/src/neovim-stable/test"
]
},
"format": {
Expand All @@ -21,7 +23,11 @@
},
"diagnostics": {
"libraryFiles": "Disable",
"globals": [],
"globals": [
"NVT_FUNCTEST_CONTEXT",
"NVT_FUNCTEST_EVENTS",
"NVT_FUNCTEST_CLIPBOARD_LINES"
],
"neededFileStatus": {
"ambiguity-1": "Any",
"assign-type-mismatch": "Any",
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# TODO functest move any checks from ci.yml into here, adding any missing e.g. codeformat

all: lint style check

#
Expand All @@ -14,15 +16,18 @@ check: luals
#
luacheck:
luacheck --codes --quiet lua --exclude-files "**/_meta/**"
luacheck --codes --quiet test

style-check:
scripts/luals-check.sh codestyle-check
scripts/luals-check.sh codestyle-check lua
scripts/luals-check.sh codestyle-check scripts

style-doc:
scripts/doc-comments.sh

luals:
scripts/luals-check.sh
scripts/luals-check.sh lua
scripts/luals-check.sh scripts

#
# format
Expand All @@ -47,6 +52,5 @@ help-update:
help-check: help-update
git diff --exit-code doc/nvim-tree-lua.txt


.PHONY: all lint style check luacheck style-check style-doc luals format-fix format-check help-update help-check

2 changes: 1 addition & 1 deletion doc/nvim-tree-lua.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ Config: actions *nvim-tree-config-actions*
• {use_system_clipboard}? (`boolean`, default: `true`) Use the system
clipboard for copy/paste. Copied text will be
stored in registers `+` (system), otherwise,
it will be stored in `1` and `"`
it will be stored in `1`

*nvim_tree.config.actions.change_dir*
vim |current-directory| behaviour
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim-tree/_meta/config/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ error("Cannot require a meta file")

---@class nvim_tree.config.actions
---
---Use the system clipboard for copy/paste. Copied text will be stored in registers `+` (system), otherwise, it will be stored in `1` and `"`
---Use the system clipboard for copy/paste. Copied text will be stored in registers `+` (system), otherwise, it will be stored in `1`
---(default: `true`)
---@field use_system_clipboard? boolean
---
Expand Down
56 changes: 54 additions & 2 deletions lua/nvim-tree/appearance/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,7 @@ M.LEGACY_LINKS = {
NvimTreeDiagnosticHintFolderHL = "NvimTreeLspDiagnosticsHintFolderText",
}

---Create all highlight groups and links. Idempotent.
function M.highlight()
local function highlight_main()
-- non-linked
for _, g in ipairs(M.HIGHLIGHT_GROUPS) do
if g.def then
Expand All @@ -208,4 +207,57 @@ function M.highlight()
end
end

---Create all NvimTree* highlight groups with just a unique foreground colour
---NvimTreeCursorLine has just a background colour
---Add a CL variant for each group with the same background colour as NvimTreeCursorLine
---This is done here, as redefining groups in the test context is a performance issue, due to the number of :help ui-event-hl_attr_define events
local function highlight_functest()
-- arbitrary cursor line "unique" value: math.random(tonumber('0x707070'),tonumber('0x909090'))
local hex_bg = "#85a450"

-- unique colour for each group, descending from #fefefe
local i, r, g, b = 1, 254, 254, 254
local rgb_fg, hex_fg

-- build the cursor line first, background only
local hgs = vim.tbl_filter(function(hg)
if hg.group == "NvimTreeCursorLine" then
vim.api.nvim_set_hl(0, "NvimTreeCursorLine", { bg = hex_bg })
return false
else
return true
end
end, M.HIGHLIGHT_GROUPS)

-- define the remainder with unique foregrounds
for _, hg in ipairs(hgs) do
-- next unique fg colour
rgb_fg = r * 256 * 256 + g * 256 + b
hex_fg = string.format("#%x", rgb_fg)
i = i + 1
if (i % 256 == 0) then
b, g, r = 254, 254, r - 1
elseif (i % 16 == 0) then
b, g = 254, g - 1
else
b = b - 1
end

-- add the group's concrete definition with fg only
vim.api.nvim_set_hl(0, hg.group, { fg = hex_fg })

-- create an NvimTreeCursorLine variant
vim.api.nvim_set_hl(0, hg.group .. "CL", { fg = hex_fg, bg = hex_bg })
end
end

---Create all highlight groups and links. Idempotent.
function M.highlight()
if NVT_FUNCTEST_CONTEXT then ---@diagnostic disable-line: undefined-global
highlight_functest()
else
highlight_main()
end
end

return M
3 changes: 1 addition & 2 deletions lua/nvim-tree/core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ function M.get_nodes_starting_line()
end

function M.purge_all_state()
view.close_all_tabs()
view.abandon_all_windows()
view.purge_state()
if TreeExplorer then
git.purge_state()
TreeExplorer:destroy()
Expand Down
6 changes: 6 additions & 0 deletions lua/nvim-tree/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ function M.abandon_all_windows()
end
end

function M.purge_state()
M.close_all_tabs()
M.abandon_all_windows()
view_state.Active.cursors = {}
end

---@param opts table|nil
---@return boolean
function M.is_visible(opts)
Expand Down
30 changes: 30 additions & 0 deletions scripts/check-nvim-src.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env sh

# common script to check the availability of neovim source
# - NOP if $DIR_NVIM_SRC is defined
# - sets $DIR_NVIM_SRC to /tmp/src/neovim-stable if present
# - otherwise prompts with instructions
# script must be sourced to receive the exported $DIR_NVIM_SRC

DIR_NVIM_SRC_DEF="/tmp/src/neovim-stable"

if [ -z "${DIR_NVIM_SRC}" ] && [ -d "${DIR_NVIM_SRC_DEF}" ]; then
export DIR_NVIM_SRC="${DIR_NVIM_SRC_DEF}"
fi

if [ ! -d "${DIR_NVIM_SRC}" ]; then
cat << EOM

Nvim stable source is required to run ${0}

Unavailable: ${DIR_NVIM_SRC_DEF} or \$DIR_NVIM_SRC=${DIR_NVIM_SRC}

Please:
mkdir -p ${DIR_NVIM_SRC_DEF}
curl -L 'https://github.com/neovim/neovim/archive/refs/tags/stable.tar.gz' | tar zx --directory $(dirname "${DIR_NVIM_SRC_DEF}")
or use your own e.g.
export DIR_NVIM_SRC="\${HOME}/src/neovim"

EOM
exit 1
fi
Loading
Loading