feat(L03): add Neovim navigation and editing card

This commit is contained in:
user
2026-07-21 17:58:46 +02:00
commit e526b8c6f3
38 changed files with 7113 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env bash
set -euo pipefail
work="$(mktemp -d)"; trap 'rm -rf -- "$work"' EXIT
printf 'alpha\nbeta\ngamma\n' >"$work/history.txt"
EVIDENCE="$work/history-counts.txt" nvim --headless -u NONE -n "$work/history.txt" \
'+lua vim.api.nvim_buf_set_lines(0,-1,-1,false,{"delta"}); local a=vim.api.nvim_buf_line_count(0); vim.cmd("silent undo"); local u=vim.api.nvim_buf_line_count(0); vim.cmd("silent redo"); local r=vim.api.nvim_buf_line_count(0); vim.cmd("silent write"); vim.fn.writefile({a.." "..u.." "..r},vim.env.EVIDENCE)' '+qa'
read -r after_change after_undo after_redo <"$work/history-counts.txt"
[[ "$after_change" -eq 4 && "$after_undo" -eq 3 && "$after_redo" -eq 4 ]]
[[ "$(tail -1 "$work/history.txt")" == delta ]]
printf 'PASS task03 after_change=4 after_undo=3 after_redo=4 saved_delta=1\n'