Docs #1

Merged
gffranco merged 15 commits from docs into main 2026-05-30 18:35:41 +00:00
6 changed files with 18 additions and 17 deletions
Showing only changes of commit 088cf81bcb - Show all commits
+2 -2
View File
@@ -93,6 +93,6 @@ jobs:
sudo apt-get install -y --no-install-recommends vim sudo apt-get install -y --no-install-recommends vim
vim --version | head -1 vim --version | head -1
- name: run Neovim keymap harness - name: run Neovim keymap harness
run: ./development/test-keymaps.sh run: ./development/tests/test-keymaps.sh
- name: run Vim keymap harness - name: run Vim keymap harness
run: ./development/test-keymaps-vim.sh run: ./development/tests/test-keymaps-vim.sh
+5 -4
View File
@@ -74,11 +74,12 @@ nuwiki/
│ ├── start-nvim.sh # Launch Neovim against a scratch wiki │ ├── start-nvim.sh # Launch Neovim against a scratch wiki
│ ├── start-vim.sh # Launch Vim against a scratch wiki │ ├── start-vim.sh # Launch Vim against a scratch wiki
│ ├── test-personal-wiki.sh # Launch Vim against your real wiki │ ├── test-personal-wiki.sh # Launch Vim against your real wiki
│ ├── test-keymaps.sh # Neovim keymap harness (CI) │ ├── syntax-diag.vim # Dump highlighting state for debugging
│ └── tests/ # Editor keymap/command harnesses (run in CI)
│ ├── test-keymaps.sh # Neovim keymap harness
│ ├── test-keymaps.lua │ ├── test-keymaps.lua
│ ├── test-keymaps-vim.sh # Vim keymap harness (CI) ├── test-keymaps-vim.sh # Vim keymap harness
── test-keymaps-vim.vim ── test-keymaps-vim.vim
│ └── syntax-diag.vim # Dump highlighting state for debugging
└── .gitea/ └── .gitea/
└── workflows/ └── workflows/
@@ -1,16 +1,16 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# development/test-keymaps-vim.sh — Vim counterpart of test-keymaps.sh. # development/tests/test-keymaps-vim.sh — Vim counterpart of test-keymaps.sh.
# #
# Pure-VimL portion only. The LSP-roundtrip keymaps (`<C-Space>`, # Pure-VimL portion only. The LSP-roundtrip keymaps (`<C-Space>`,
# `=`, `-`, …) talk to the server via vim-lsp's timer-driven async # `=`, `-`, …) talk to the server via vim-lsp's timer-driven async
# layer, which doesn't fire reliably inside `vim -e -s`. Those have # layer, which doesn't fire reliably inside `vim -e -s`. Those have
# Neovim coverage in development/test-keymaps.lua, exercising the same # Neovim coverage in development/tests/test-keymaps.lua, exercising the same
# Lua command layer + server binary. # Lua command layer + server binary.
set -euo pipefail set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
TMP="$(mktemp -d -t nuwiki-keymap-vim-test-XXXXXX)" TMP="$(mktemp -d -t nuwiki-keymap-vim-test-XXXXXX)"
trap 'rm -rf "$TMP"' EXIT trap 'rm -rf "$TMP"' EXIT
@@ -47,7 +47,7 @@ log "running harness…"
# `</dev/null` so Vim's ex-mode doesn't hang waiting on stdin; # `</dev/null` so Vim's ex-mode doesn't hang waiting on stdin;
# `timeout` so a misbehaving script can't stall CI for 30 minutes. # `timeout` so a misbehaving script can't stall CI for 30 minutes.
NUWIKI_KEYMAP_RESULTS="$RESULTS" \ NUWIKI_KEYMAP_RESULTS="$RESULTS" \
timeout 30 vim -e -s -u "$VIMRC" -c "edit $SEED" -c "source $REPO_ROOT/development/test-keymaps-vim.vim" \ timeout 30 vim -e -s -u "$VIMRC" -c "edit $SEED" -c "source $REPO_ROOT/development/tests/test-keymaps-vim.vim" \
</dev/null >"$TMP/vim.log" 2>&1 || true </dev/null >"$TMP/vim.log" 2>&1 || true
if [[ ! -f "$RESULTS" ]]; then if [[ ! -f "$RESULTS" ]]; then
@@ -1,4 +1,4 @@
" development/test-keymaps-vim.vim — driven by development/test-keymaps-vim.sh. " development/tests/test-keymaps-vim.vim — driven by development/tests/test-keymaps-vim.sh.
" "
" Pure-VimL keymap regression suite. Plain Vim's LSP path " Pure-VimL keymap regression suite. Plain Vim's LSP path
" (vim-lsp + async.vim) talks to the server via timers, which won't " (vim-lsp + async.vim) talks to the server via timers, which won't
@@ -6,7 +6,7 @@
" are restricted to the bindings whose RHS is implemented entirely in " are restricted to the bindings whose RHS is implemented entirely in
" VimL (header/link nav, `o`/`O` bullet continuation, the wrap step " VimL (header/link nav, `o`/`O` bullet continuation, the wrap step
" of `<CR>`). LSP-roundtrip bindings (`<C-Space>`, `=`, `-`, …) get " of `<CR>`). LSP-roundtrip bindings (`<C-Space>`, `=`, `-`, …) get
" their coverage from the Neovim harness in development/test-keymaps.lua " their coverage from the Neovim harness in development/tests/test-keymaps.lua
" — same Lua codepath, same server. " — same Lua codepath, same server.
let s:results = [] let s:results = []
@@ -1,4 +1,4 @@
-- development/test-keymaps.lua — driven by development/test-keymaps.sh. -- development/tests/test-keymaps.lua — driven by development/tests/test-keymaps.sh.
-- --
-- Headless Neovim harness for the buffer-local keymaps registered by -- Headless Neovim harness for the buffer-local keymaps registered by
-- `ftplugin/vimwiki.vim` + `lua/nuwiki/keymaps.lua`. Each case sets up -- `ftplugin/vimwiki.vim` + `lua/nuwiki/keymaps.lua`. Each case sets up
@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# #
# development/test-keymaps.sh — drive development/test-keymaps.lua under # development/tests/test-keymaps.sh — drive development/tests/test-keymaps.lua under
# headless Neovim and report pass/fail per buffer-local keymap. # headless Neovim and report pass/fail per buffer-local keymap.
# #
# The Lua harness needs a real LSP attachment (most keymaps dispatch # The Lua harness needs a real LSP attachment (most keymaps dispatch
@@ -14,7 +14,7 @@
set -euo pipefail set -euo pipefail
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
TMP="$(mktemp -d -t nuwiki-keymap-test-XXXXXX)" TMP="$(mktemp -d -t nuwiki-keymap-test-XXXXXX)"
trap 'rm -rf "$TMP"' EXIT trap 'rm -rf "$TMP"' EXIT
@@ -53,7 +53,7 @@ log "running harness…"
# stalling CI runners indefinitely. # stalling CI runners indefinitely.
NUWIKI_KEYMAP_RESULTS="$RESULTS" \ NUWIKI_KEYMAP_RESULTS="$RESULTS" \
timeout 60 nvim --clean -u "$INIT" --headless "$TMP/wiki/index.wiki" \ timeout 60 nvim --clean -u "$INIT" --headless "$TMP/wiki/index.wiki" \
-c "luafile $REPO_ROOT/development/test-keymaps.lua" \ -c "luafile $REPO_ROOT/development/tests/test-keymaps.lua" \
>"$TMP/nvim.log" 2>&1 || true >"$TMP/nvim.log" 2>&1 || true
if [[ ! -f "$RESULTS" ]]; then if [[ ! -f "$RESULTS" ]]; then