Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
230 commits
Select commit Hold shift + click to select a range
2c80390
test: neovim functional test integration and example test
alex-courtis Sep 8, 2026
11e906f
test: add luals library for functionaltest framework
alex-courtis Sep 8, 2026
4a7a641
test: add NvimTree* hl group handling to functionaltest
alex-courtis Sep 8, 2026
7f91260
test: add luals library for functionaltest framework
alex-courtis Sep 9, 2026
44f4b89
test: create unique NvimTree HL group definitions
alex-courtis Sep 10, 2026
21ec0ec
test: create unique NvimTree HL group definitions
alex-courtis Sep 10, 2026
64a515b
test: refactor functional test lifecycle, add another test
alex-courtis Sep 10, 2026
58b57d7
test: simplify package loading
alex-courtis Sep 10, 2026
9f22d21
test: add text-only functional test
alex-courtis Sep 11, 2026
a84ceb8
test: Screen 80 x 25 for more deterministic window sizes
alex-courtis Sep 11, 2026
c2f4baa
test: Screen 80 x 25 for more deterministic window sizes
alex-courtis Sep 11, 2026
41134e6
test: somewhat idempotent nvt_hl_attr_ids called in before_each
alex-courtis Sep 11, 2026
13bc738
test: add an interactive node open test
alex-courtis Sep 11, 2026
bc5c3c9
test: Screen 80 x 24 for more deterministic window sizes
alex-courtis Sep 11, 2026
3c3eb3d
test: purge state clears cursor positions
alex-courtis Sep 11, 2026
cd4b14b
test: functionaltest.sh driver allows test selection
alex-courtis Sep 14, 2026
b1293e9
test: func tests use fixed contents data directories
alex-courtis Sep 14, 2026
78d9537
test: add functional test live for creating test data
alex-courtis Sep 14, 2026
c7b7445
test: add live test capture functionality
alex-courtis Sep 15, 2026
aa5d30c
test: add live test capture functionality
alex-courtis Sep 15, 2026
75f59e7
test: add live test capture functionality
alex-courtis Sep 15, 2026
579baee
test: add live test capture functionality
alex-courtis Sep 15, 2026
f21f295
test: add live test capture functionality
alex-courtis Sep 16, 2026
1b2a406
test: add root dir to tests
alex-courtis Sep 16, 2026
0f76d14
test: document highlight group testing
alex-courtis Sep 16, 2026
ead01cf
test: add fs/create/dir
alex-courtis Sep 16, 2026
113151d
test: clearer func temp directories
alex-courtis Sep 17, 2026
aa0222d
test: live_dump no longer global
alex-courtis Sep 17, 2026
105b4b6
test: optionally collapse screen dumps
alex-courtis Sep 17, 2026
4857b93
test: add test/ to lint and style
alex-courtis Sep 18, 2026
352ed56
test: extract common scripts/check-nvim-src.sh
alex-courtis Sep 18, 2026
a38b6ba
test: add functionaltest ci job
alex-courtis Sep 18, 2026
e5bf2eb
test: ensure no empty directories in func test data
alex-courtis Sep 18, 2026
65e08c5
test: run functest against nightly
alex-courtis Sep 18, 2026
44ddb16
test: stable and nightly test compatibility
alex-courtis Sep 18, 2026
7ee72ca
test: luals-check for functests
alex-courtis Sep 18, 2026
55c2c3f
test: luals-check uses neovim source runtime
alex-courtis Sep 18, 2026
12184ac
test: add luals for functest
alex-courtis Sep 18, 2026
a0c3850
test: stable and nightly test compatibility
alex-courtis Sep 18, 2026
7c6d4cd
test: func tests are responsible for setting up and tearing down data
alex-courtis Sep 21, 2026
602259b
test: link test and lua separately under nvim src
alex-courtis Sep 22, 2026
c003d1b
test: link test and lua separately under nvim src
alex-courtis Sep 22, 2026
25bf96b
test: extract testutil.lua
alex-courtis Sep 22, 2026
cfb7dc2
test: extract fixtures.lua
alex-courtis Sep 22, 2026
abc19d4
test: extract fixtures.lua
alex-courtis Sep 22, 2026
d471aef
test: shell script is responsible for creating test directory
alex-courtis Sep 23, 2026
8cb910f
test: shell script is responsible for creating test directory
alex-courtis Sep 23, 2026
06e18e5
test: shell script is responsible for creating test directory
alex-courtis Sep 23, 2026
d268fb0
test: complete functionaltest.sh script
alex-courtis Sep 24, 2026
1a5d7d2
test: complete functionaltest.sh script
alex-courtis Sep 24, 2026
076021d
test: complete functionaltest.sh script
alex-courtis Sep 24, 2026
57c4e0a
test: extract utils
alex-courtis Sep 24, 2026
00c6cdc
test: more dir tests
alex-courtis Sep 24, 2026
cdedf7c
test: extract fixtures, remove utils
alex-courtis Sep 24, 2026
78b87b1
test: more dir create tests, add file create tests
alex-courtis Sep 24, 2026
c31a08d
test: add event tests, implement for dirs
alex-courtis Sep 25, 2026
bd6018c
test: file event tests
alex-courtis Sep 25, 2026
dc3f272
test: illegal location create tests
alex-courtis Sep 25, 2026
82da158
test: lint/style
alex-courtis Sep 25, 2026
fe00083
test: lint/style
alex-courtis Sep 25, 2026
2d9f736
test: always teardown on functest failures to prevent luals picking u…
alex-courtis Sep 25, 2026
fde6460
test: run all requested functests, exiting with number of failrues
alex-courtis Sep 28, 2026
761053a
test: inject test failures to test CI
alex-courtis Sep 28, 2026
1e4bf43
Revert "test: inject test failures to test CI"
alex-courtis Sep 28, 2026
03f77fe
test: include nvim-tree source in test plumbing
alex-courtis Sep 28, 2026
d5f8bf6
test: use appearance source to simplify highlight groups
alex-courtis Sep 28, 2026
4021c14
test: revert commented test
alex-courtis Sep 28, 2026
4d69d76
test: add nvim-tree source to test lpath, remove links
alex-courtis Sep 28, 2026
396538a
test: func test runs from a single link under nvim src
alex-courtis Sep 29, 2026
a3533f9
test: func test package is the nvim-tree source link itself
alex-courtis Sep 29, 2026
8e3c679
test: func test package is the nvim-tree source link itself
alex-courtis Sep 29, 2026
880d674
test: proper namespace for nvt tests
alex-courtis Sep 29, 2026
ccf2971
test: proper namespace for nvt tests
alex-courtis Sep 29, 2026
35fd853
test: add events_clear
alex-courtis Sep 29, 2026
01592d6
test: more fs.create.dir tests
alex-courtis Sep 30, 2026
f8d713a
test: functionaltest.sh -l operates on any file or dir, finding data …
alex-courtis Sep 30, 2026
4d31949
test: more fs.create.dir tests
alex-courtis Sep 30, 2026
b71fb45
doc: fix incorrect register doc for actions.use_system_clipboard
alex-courtis Sep 30, 2026
718411d
test: add func fs.copy.node
alex-courtis Sep 30, 2026
6bfc8a2
test: add func fs.copy.node
alex-courtis Sep 30, 2026
a770230
doc: fix incorrect register doc for actions.use_system_clipboard
alex-courtis Sep 30, 2026
54e96ca
test: add func fs.copy.node
alex-courtis Sep 30, 2026
a7d8f96
test: add func fs.copy.node
alex-courtis Sep 30, 2026
02034b2
test: add func fs.copy.node
alex-courtis Sep 30, 2026
a96394a
test: add screen width/height params
alex-courtis Sep 30, 2026
86a0bce
test: add dummy clipboard fixture
alex-courtis Oct 1, 2026
f2a856d
test: add dummy clipboard fixture
alex-courtis Oct 1, 2026
c2db785
test: remove poc test
alex-courtis Oct 2, 2026
a4d4fff
test: don't use ext_linegrid when expecting HL groups for performance…
alex-courtis Oct 2, 2026
508d285
test: remove poc test
alex-courtis Oct 2, 2026
771e037
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
1dd4935
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
a9ba7b1
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
003d2f3
test: functest highlight groups are setup by main, not test, to avoid…
alex-courtis Oct 2, 2026
6dfd8b6
test: create_sessions now calls setup and adds attr_ids
alex-courtis Oct 2, 2026
4240706
test: organise copy structure nicely
alex-courtis Oct 2, 2026
ad340fa
test: organise fs.create structure nicely
alex-courtis Oct 2, 2026
0806b7a
test: add fs/cut
alex-courtis Oct 5, 2026
f0d1695
test: add fs cut override copy
alex-courtis Oct 5, 2026
8d84061
test: add fs copy override cut
alex-courtis Oct 5, 2026
9f060f6
test: add fs print_clipboard
alex-courtis Oct 5, 2026
8254982
test: add fs print_clipboard
alex-courtis Oct 5, 2026
7f5c040
test: normalise names, use functional area as describe
alex-courtis Oct 5, 2026
c55ba1a
test: add fs.paste, wip
alex-courtis Oct 6, 2026
6119b00
test: fs.paste, wip
alex-courtis Oct 6, 2026
218c462
test: fs.paste cut tests buffer moved
alex-courtis Oct 6, 2026
e56a7f6
test: fs.paste API tests
alex-courtis Oct 7, 2026
e18aad9
test: remove TODO from BUGs
alex-courtis Oct 8, 2026
44d2c0a
test: cut_spec uses internal API pending resolution of #3362
alex-courtis Oct 8, 2026
74e0d2a
test: paste multiple copied
alex-courtis Oct 9, 2026
cd44a1d
test: copied_spec uses synchronous tree calls
alex-courtis Oct 9, 2026
9810413
Revert "test: copied_spec uses synchronous tree calls"
alex-courtis Oct 12, 2026
7feb787
test: use poke_eventloop to snc fs/paste tests, needs a better solution
alex-courtis Oct 12, 2026
35009d3
test: add utils with feed_sync, needs migration for all tests
alex-courtis Oct 13, 2026
f757896
test: use feed_sync for all functests
alex-courtis Oct 13, 2026
aab5a5c
test: fs.create prompt timing fixes
alex-courtis Oct 13, 2026
4fb7169
test: namespace functionaltest methods so that 0.12 global compatibil…
alex-courtis Oct 13, 2026
e94541a
test: namespace functionaltest methods so that 0.12 global compatibil…
alex-courtis Oct 13, 2026
ec79396
test: add missing API test variants
alex-courtis Oct 13, 2026
6b65e2d
Revert "test: namespace functionaltest methods so that 0.12 global co…
alex-courtis Oct 13, 2026
e2305b9
Revert "test: namespace functionaltest methods so that 0.12 global co…
alex-courtis Oct 13, 2026
d97b629
test: add multiple paste tests
alex-courtis Oct 13, 2026
ebfee39
test: add multiple paste tests
alex-courtis Oct 13, 2026
5606461
test: add fs.clear_clipboard tests
alex-courtis Oct 14, 2026
886b94e
test: formatting
alex-courtis Oct 14, 2026
80ef3c5
test: add fs.move tests
alex-courtis Oct 14, 2026
198c52e
test: formatting
alex-courtis Oct 14, 2026
e2c2946
test: add fs.trash tests, wip
alex-courtis Oct 14, 2026
16bb1e2
test: add buf_exists asserts, fs.trash tests, wip
alex-courtis Oct 14, 2026
2d5c4a1
test: fs.trash tests, wip
alex-courtis Oct 14, 2026
4a6309b
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
96635f1
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
7fb946e
test: tidy any unnecessary ext_cmdline
alex-courtis Oct 15, 2026
02833a4
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
ee85b0a
Revert "test: fs.trash tests, wip"
alex-courtis Oct 15, 2026
c123e2e
test: fs.trash tests, wip
alex-courtis Oct 15, 2026
20c30cd
test: notes on func test ext_cmdline and ext_messages
alex-courtis Oct 15, 2026
1ab18cd
test: print/clear clipboard use ext_messages
alex-courtis Oct 15, 2026
0be9654
test: add missing file create message assertions, add functest global…
alex-courtis Oct 15, 2026
ad4ec86
test: namespace functionaltest methods so that 0.12 global compatibil…
alex-courtis Oct 15, 2026
72a2a6c
test: notes on test mechanisms
alex-courtis Oct 15, 2026
4f6f65c
test: notes on test assertions
alex-courtis Oct 15, 2026
c99daea
test: notes on test timeouts
alex-courtis Oct 15, 2026
531f8a8
test: notes on test timeouts
alex-courtis Oct 15, 2026
29b627b
test: experiment, disable feed_sync poke to see CI test output
alex-courtis Oct 15, 2026
87052d5
Revert "test: experiment, disable feed_sync poke to see CI test output"
alex-courtis Oct 15, 2026
d093caf
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
38102d7
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
3a6e73f
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
eaf6847
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
d98fb7d
test: replace create_test_cwd.sh with lua
alex-courtis Oct 16, 2026
d8f67b2
test: each functest passes its own data dir
alex-courtis Oct 18, 2026
76b159f
test: copy data directory from source, enable live, allow dirs other …
alex-courtis Oct 19, 2026
964261b
test: execute all test in one call to make functionaltest
alex-courtis Oct 19, 2026
5c8527e
Revert "test: purge state clears cursor positions"
alex-courtis Oct 19, 2026
d9b3fea
test: simplify func test script and document
alex-courtis Oct 21, 2026
e261f49
test: add events_received_unordered assert
alex-courtis Oct 22, 2026
f034ae6
test: use relative paths for func test, use nvim version under test f…
alex-courtis Oct 22, 2026
2f5e7bf
test: experiment running fs.paste test first for performance improvement
alex-courtis Oct 22, 2026
03cd8e8
test: undo successful? experiment running fs.paste test first for per…
alex-courtis Oct 22, 2026
a24890f
test: screen:expect uses attr_ids = {} when testing cmdline for perfo…
alex-courtis Oct 23, 2026
0a09348
test: screen:expect uses attr_ids = {} when testing messages for perf…
alex-courtis Oct 23, 2026
4b9e26d
test: screen:expect uses attr_ids = {} when testing messages for perf…
alex-courtis Oct 23, 2026
fa9cb1f
test: temporarily remove attr_ids={} for performance testing
alex-courtis Oct 25, 2026
00500e6
test: disable all screen_opts except when necessary, for great perfor…
alex-courtis Oct 27, 2026
eefca34
test: try using set_default_attr_ids vs add_extra_attr_ids performance
alex-courtis Oct 27, 2026
24ac0d2
test: try caching attr_ids for performance
alex-courtis Oct 27, 2026
51dde6e
Revert "test: try caching attr_ids for performance"
alex-courtis Oct 27, 2026
8bdf747
Revert "test: try using set_default_attr_ids vs add_extra_attr_ids pe…
alex-courtis Oct 27, 2026
f774ac3
test: tidy todo
alex-courtis Oct 27, 2026
f1dafdb
test: basic fs.remove
alex-courtis Oct 27, 2026
5b1db39
test: add fs.remove tests
alex-courtis Oct 27, 2026
9cd820e
test: add fs.remove tests
alex-courtis Oct 27, 2026
b817906
test: add fs.remove tests
alex-courtis Oct 27, 2026
c8936a0
test: add fs.remove tests
alex-courtis Oct 27, 2026
7bda853
test: add fs.remove tests
alex-courtis Oct 27, 2026
1dffe1c
test: add fs.remove tests
alex-courtis Oct 27, 2026
9974e80
test: add fs.remove tests
alex-courtis Oct 27, 2026
a8060fd
test: add fs.remove tests
alex-courtis Oct 28, 2026
2b8ea09
test: add fs.remove tests
alex-courtis Oct 28, 2026
4384b4b
test: add fs.remove tests
alex-courtis Oct 28, 2026
f407eb3
test: ensure testnvim is always called
alex-courtis Oct 28, 2026
3efc90d
test: organise func test structure
alex-courtis Oct 28, 2026
5f102b0
test: organise func test structure
alex-courtis Oct 28, 2026
20eb462
test: fs.copy.absolute_path
alex-courtis Oct 28, 2026
f542fb4
test: fs.copy.basename
alex-courtis Oct 28, 2026
d66e67c
test: fs.copy.filename
alex-courtis Oct 28, 2026
aa14bcf
test: fs.copy.relative_path
alex-courtis Oct 28, 2026
674d45b
test: fs.rename
alex-courtis Oct 29, 2026
1b959b8
test: fs.rename enabled following bug fix
alex-courtis Oct 29, 2026
03cda51
test: fs.rename
alex-courtis Oct 29, 2026
91e9de4
test: node.open.horizontal
alex-courtis Oct 29, 2026
4afac69
test: node.open.vertical
alex-courtis Oct 30, 2026
1d5522e
test: fix create detection of existing files when creating directories
alex-courtis Oct 30, 2026
edb6b2d
test: output path on create failure
alex-courtis Oct 30, 2026
bccfc8a
test: fix create detection of existing files when creating directories
alex-courtis Oct 30, 2026
ad67afc
test: fs.create file fails on invalid path, pending upstream fix
alex-courtis Nov 1, 2026
25b93cc
test: fs.create file fails on invalid path, pending upstream fix
alex-courtis Nov 1, 2026
5c19ab5
test: fs.create FolderCreated events are correct, pending upstream fix
alex-courtis Nov 1, 2026
36276e3
test: fs.create FolderCreated events are correct
alex-courtis Nov 1, 2026
ecbabc2
test: clipboard copy/cut messages consistent, requieres upstream merg…
alex-courtis Nov 2, 2026
8db397b
fix(clipboard): consistent 'copied to' and 'cut to' messages
alex-courtis Nov 2, 2026
03d5b35
test: tidy todos replacing with issue refs
alex-courtis Nov 2, 2026
57946d7
test: fs.paste api test OK, pending upstream fix
alex-courtis Nov 3, 2026
3b890ab
test: fs.paste api test OK
alex-courtis Nov 3, 2026
91905e3
test: Decorator and tree.get_nodes tests
alex-courtis Nov 15, 2026
2398806
test: always compress dump lines, simplify live init
alex-courtis Nov 15, 2026
6468a77
test: always compress dump lines, simplify live init
alex-courtis Nov 15, 2026
d6073de
test: readme
alex-courtis Nov 16, 2026
178f776
test: pending #3392
alex-courtis Nov 16, 2026
e850c2c
test: replace NVT_FUNCTEST_CONTEXT with builtin NVIM_TEST
alex-courtis Nov 17, 2026
85157bf
add log ms, add log.stack, remove unused log.node
alex-courtis Nov 18, 2026
81f2e86
add params to log.stack
alex-courtis Nov 18, 2026
f6f22ae
test: logs to /tmp/nvt_test.log
alex-courtis Nov 18, 2026
d3d7b16
test: logs to /tmp/nvt_test.log
alex-courtis Nov 18, 2026
9c2d87b
test: log file has test id, use _G globals in fixtures
alex-courtis Nov 18, 2026
1ed2b62
test: readme
alex-courtis Nov 19, 2026
ff25566
test: readme
alex-courtis Nov 19, 2026
16f6e09
test: readme
alex-courtis Nov 19, 2026
13cb8bd
test: move all functional testing to makefile and main ci
alex-courtis Nov 19, 2026
3bf0f18
test: move all functional testing to makefile and main ci
alex-courtis Nov 19, 2026
4e58c3c
test: move all functional testing to makefile and main ci
alex-courtis Nov 19, 2026
d75c065
Revert "test: move all functional testing to makefile and main ci"
alex-courtis Nov 19, 2026
a5bb195
Revert "test: move all functional testing to makefile and main ci"
alex-courtis Nov 19, 2026
ebd38b9
Revert "test: move all functional testing to makefile and main ci"
alex-courtis Nov 19, 2026
1ac1f13
test: formatting
alex-courtis Nov 19, 2026
fce2e9c
test: move all functional testing to makefile and main ci
alex-courtis Nov 19, 2026
6b1d8bc
test: move all functional testing checks to makefile and main ci
alex-courtis Nov 19, 2026
ee516bf
test: move all functional testing checks to makefile and main ci
alex-courtis Nov 19, 2026
350376c
back out unnecessary changes
alex-courtis Nov 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
50 changes: 44 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,59 @@ jobs:
curl -L "https://github.com/CppCXY/EmmyLuaCodeStyle/releases/download/${{ matrix.emmyluacodestyle_version }}/linux-x64.tar.gz" | tar zx --directory EmmyLuaCodeStyle
echo "EmmyLuaCodeStyle/linux-x64/bin" >> "$GITHUB_PATH"

- run: make check
- 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 doc

- run: make luals-check

- run: make luals-check-test

- run: make style
- run: make style-check

- run: make style-check-test

- run: make style-doc

- run: make format-check

- name: build Nvim from source
- 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 doc
make

- run: make help-check
if: ${{ matrix.nvim_version == 'stable' }}
- run: scripts/functionaltest.sh -a
13 changes: 11 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ 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",
}

return M
5 changes: 3 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",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a problem. If you don't have Nvim source available, luals cannot parse test code.

"/tmp/src/neovim-stable/test"
]
},
"format": {
Expand All @@ -21,7 +23,6 @@
},
"diagnostics": {
"libraryFiles": "Disable",
"globals": [],
"neededFileStatus": {
"ambiguity-1": "Any",
"assign-type-mismatch": "Any",
Expand Down
25 changes: 18 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,46 @@ all: lint style check
#
lint: luacheck

style: style-check style-doc
style: style-check style-check-test style-doc

check: luals
check: luals-check luals-check-test

#
# subtasks
#
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-check-test:
scripts/luals-check.sh codestyle-check test

style-doc:
scripts/doc-comments.sh

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

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

#
# format
#
format-fix:
CodeFormat format --config .editorconfig --workspace lua
CodeFormat format --config .editorconfig --workspace test

format-check:
CodeFormat format --config .editorconfig --workspace lua
git diff --exit-code lua
CodeFormat format --config .editorconfig --workspace test
git diff --exit-code test

#
# utility
Expand All @@ -47,6 +59,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
.PHONY: all lint style check luacheck style-check style-check-test style-doc luals-check luals-check-test 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 @@ -1715,7 +1715,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 `"`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

found during testing

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 Down Expand Up @@ -222,4 +221,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_test()
-- 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 os.getenv("NVIM_TEST") == "1" then
highlight_test()
else
highlight_main()
end
end

return M
50 changes: 37 additions & 13 deletions lua/nvim-tree/log.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,41 @@ end
---@param ... any arguments for string.format
function M.line(typ, fmt, ...)
if M.enabled(typ) then
M.raw(typ, string.format("[%s] [%s] %s\n", os.date("%Y-%m-%d %H:%M:%S"), typ, (fmt or "???")), ...)
local time = vim.uv.clock_gettime("realtime")
M.raw(typ, string.format("[%s.%03d] [%s] %s\n", os.date("%Y-%m-%d %H.%M.%S", time.sec), time.nsec / 1000000, typ, (fmt or "???")), ...)
end
end

local inspect_opts = {}

---@param opts table
function M.set_inspect_opts(opts)
inspect_opts = opts
end

--- Write to log file the inspection of a node
--- Write to log file with stack appended after newline
--- Use :cfile or :lfile on the log to enable qf/loc navigation
---@param typ LogTypes as per log.types config
---@param node Node node to be inspected
---@param fmt string for string.format
---@param ... any arguments for string.format
function M.node(typ, node, fmt, ...)
function M.stack(typ, fmt, ...)
if M.enabled(typ) then
M.raw(typ, string.format("[%s] [%s] %s\n%s\n", os.date("%Y-%m-%d %H:%M:%S"), typ, (fmt or "???"), vim.inspect(node, inspect_opts)), ...)
local stack = ""
local level = 2 -- exclude getinfo and this stack function
local info = debug.getinfo(level)
while info do
-- maybe get params
local params = ""
for pos = 1, info.nparams, 1 do
local name, val = debug.getlocal(level, pos)
params = string.format("%s%s%s=%s", params, (pos == 1 and "" or ", "), tostring(name), tostring(val))
end

-- tidy source and attempt to normalise to a relative path
-- this could be done via vim.pack however that is still a work in progress, notably functests still use :packadd
local source = info.source:gsub("^@", ""):gsub(".*(lua/nvim%-tree/.*)", "%1")

-- render stack,
stack = string.format("%s%s:%d: %s %s\n", stack, source, info.currentline, info.name or "", params)
level = level + 1
info = debug.getinfo(level)
end

M.line(typ, fmt, ...)
M.raw(typ, "%s", stack)
end
end

Expand All @@ -116,7 +132,15 @@ end
function M.start()
if config.g.log and config.g.log.enable and config.g.log.types then
types = config.g.log.types
file_path = string.format("%s/nvim-tree.log", vim.fn.stdpath("log"), os.date("%H:%M:%S"), vim.env.USER)
if os.getenv("NVIM_TEST") ~= "1" then
file_path = string.format("%s/nvim-tree.log", vim.fn.stdpath("log"))
else
if _G._nvim_test_id then
file_path = "/tmp/nvt_test." .. _G._nvim_test_id .. ".log"
else
file_path = "/tmp/nvt_test.log"
end
end
if config.g.log.truncate then
os.remove(file_path)
end
Expand Down
30 changes: 30 additions & 0 deletions scripts/check-nvim-src.sh

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extracted common code

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