feat(keymap): close preview with q / <Esc> / <C-c>, not <CR> (#22)#24
Merged
Conversation
Closing the floating/tab preview window on <Enter> is unintuitive (feedback on #22). Drop <CR> from the default close keys and add <C-c>; the title's proposed `Q` is omitted as an odd binding. <CR> keeps the block-toggle behavior from #21 and is now a pure no-op when the cursor is not on a fold / expandable region. The cr_is_close fallback remains so callers can still opt <CR> into close_keys. Docs (README.md / README.ja.md / doc/md-render.txt / doc/md-render.jax) and tests/key_toggle_test.lua updated accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #22.
プレビューウィンドウ (フローティング / タブ) を
<Enter>で閉じるのは直感的ではない、というフィードバックを受けての変更です。デフォルトの閉じるキーから<CR>を外し、<C-c>を追加しました。Issue タイトルにあるQは閉じるキーとして不自然なので採用していません。変更点
q/<Esc>/<CR>からq/<Esc>/<C-c>に変更。<CR>は Toggle folding blocks with keys in addition to mouse clicking #21 で入れたカーソル行のブロックトグル動作のみを担い、該当しない行では何もしない (ウィンドウは閉じない) ようになりました。close_keysへ<CR>を含めた場合は従来どおり閉じる (cr_is_closeフォールバックは維持)。テスト
tests/key_toggle_test.luaを更新 (<CR>がデフォルトで閉じないこと、<C-c>/qが閉じること、<CR>明示時のフォールバックを追加。計 18 アサーション)。make test全パス (回帰なし)。ドキュメント (
README.md/README.ja.md/doc/md-render.txt/doc/md-render.jax) のキー一覧も更新済み。🤖 Generated with Claude Code