feat(client): add per-subgroup Vim mapping opt-out globals
The plain-Vim ftplugin only exposed a whole-layer
g:nuwiki_no_default_mappings gate, so Vim users could not drop a single
keymap group the way Neovim users can via mappings.<group> = false. Add
g:nuwiki_no_{wiki_prefix,links,lists,headers,table_editing,diary,
html_export,text_objects}_mappings, each wrapping its group block, to
reach parity with lua/nuwiki/keymaps.lua. Cover them with a dedicated
opt-out harness and document them in the README and help file.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -59,7 +59,44 @@ fi
|
||||
|
||||
cat "$RESULTS"
|
||||
|
||||
if grep -qE '^SUMMARY: [0-9]+ passed, 0 failed' "$RESULTS"; then
|
||||
if ! grep -qE '^SUMMARY: [0-9]+ passed, 0 failed' "$RESULTS"; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# ===== Per-subgroup opt-out run =====
|
||||
# Fresh Vim instance with a subset of g:nuwiki_no_<group>_mappings set
|
||||
# *before* the ftplugin loads, so we can assert the disabled groups drop
|
||||
# their bindings while the rest survive.
|
||||
|
||||
VIMRC_OPTOUT="$TMP/vimrc-optout"
|
||||
cat > "$VIMRC_OPTOUT" <<EOF
|
||||
set nocompatible
|
||||
let &runtimepath = '$REPO_ROOT' . ',' . &runtimepath
|
||||
let g:nuwiki_no_wiki_prefix_mappings = 1
|
||||
let g:nuwiki_no_links_mappings = 1
|
||||
let g:nuwiki_no_headers_mappings = 1
|
||||
let g:nuwiki_no_text_objects_mappings = 1
|
||||
filetype plugin indent on
|
||||
syntax enable
|
||||
EOF
|
||||
|
||||
RESULTS_OPTOUT="$TMP/results-optout.txt"
|
||||
|
||||
log "running opt-out harness…"
|
||||
NUWIKI_KEYMAP_RESULTS="$RESULTS_OPTOUT" \
|
||||
timeout 30 vim -e -s -u "$VIMRC_OPTOUT" -c "edit $SEED" -c "source $REPO_ROOT/development/tests/test-keymaps-vim-optout.vim" \
|
||||
</dev/null >"$TMP/vim-optout.log" 2>&1 || true
|
||||
|
||||
if [[ ! -f "$RESULTS_OPTOUT" ]]; then
|
||||
echo 'keymap opt-out harness produced no output' >&2
|
||||
echo '--- vim log ---' >&2
|
||||
cat "$TMP/vim-optout.log" >&2 || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat "$RESULTS_OPTOUT"
|
||||
|
||||
if grep -qE '^SUMMARY: [0-9]+ passed, 0 failed' "$RESULTS_OPTOUT"; then
|
||||
exit 0
|
||||
fi
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user