Skip to content

Quick Capture Shortcuts Are Dead In Normal And Visual Mode #942

Closed

Description

@uNyanda
  • Type: Bug
  • Severity: Medium

Environment

  • OS: Linux
  • WM: Niri
  • Compositor: Wayland
  • Software version: 2.69.1

Description

The Quick capture window advertises four shortcuts in its footer, and three of them are dead or wrong when Vim mode is on and the editor holds focus:

Advertised Does this
Mod+Enter save ✅
Mod+N new ❌ in normal mode, Vim's cursor-down eats it
Mod+P notes ❌ in normal mode, Vim's cursor-up eats it
Mod+⇧P cmd ✅

Mod+W (close the window) is affected too, though the footer does not advertise it. In normal mode it acts as Vim's window-command prefix instead.

Only insert mode works, because that is the one mode where Vim does not claim these chords.

Steps to Reproduce

  1. Turn on Vim mode.
  2. Open the Quick capture window.
  3. Press Escape so the editor is in normal mode.
  4. Press Ctrl+N.
  5. Observe that nothing happens and the cursor moves down instead.
  6. Press Ctrl+P.
  7. Observe that nothing happens and the cursor moves up instead.
  8. Press Ctrl+W.
  9. Observe that the window does not close and the window command prefix engages.
  10. Press i to enter insert mode, then repeat steps 4 and 6.
  11. Observe that both now work.

On macOS, substitute Cmd for Ctrl. The chords are Cmd+N, Cmd+P and Cmd+W.

Expected Behaviour

The shortcuts the footer advertises should work in the same modes as they do in the main window, where Ctrl+P opens Search Notes in normal, insert and visual mode.

When an overlay is open, Ctrl+N and Ctrl+P should move the selection, and the footer should say so. The same split the main window already uses.

Actual Behaviour

In normal and visual mode the chords belong to Vim. In insert mode they work.

Ctrl+W is not advertised but is equally dead in normal mode.

Why

Quick capture renders as its own window root, so App.tsx is not loaded there at all:

isQuickCapture ? <QuickCaptureApp /> : <App />

Its key handling is a plain window listener in the bubble phase:

window.addEventListener('keydown', handler)

codemirror-vim consumes Ctrl+P, Ctrl+N and Ctrl+W as its own normal-mode chords and stops propagation, so the listener never sees them.

The main window solved exactly this twice and neither fix reached Quick capture:

Quick capture is the one window with no capture-phase handler.

The same chords are also the palette navigation keys in the main window, where Ctrl+N and Ctrl+P move the selection through a list. So the two meanings have to be split by state, exactly as the main window does.

A Second Defect On The Same Chords

With the notes picker open and its input focused, Ctrl+P currently does two things at once: the picker moves the selection up and the overlay closes.

The picker's key handler calls preventDefault() but not stopPropagation(), so the event continues to the window listener, which toggles the overlay closed. Only Escape stops propagation.

So even in insert mode, where the chord does arrive, the picker behaves in a way nobody would predict from a shortcut labelled "notes".

Affected Surfaces

  • Quick capture window, in normal and visual mode: Ctrl+N, Ctrl+P, Ctrl+W.
  • Quick capture command overlay rows, which show Ctrl+N and Ctrl+P as the hint for "Save and start a new note" and "Open another note…" while that overlay is open. On those rows the chords move the selection instead, so the hints describe a shortcut that does not do what they say in that state.
  • Mod+Enter and Mod+Shift+P are unaffected, since Vim binds neither.

Suggested Behaviour

Give Quick capture a capture-phase handler for these chords, the way the main window already has one, and keep the rest of its handler in the bubble phase. Escape has to stay where it is, because its branch reads e.defaultPrevented on the grounds that CodeMirror has already run, and at capture time that flag is not yet set.

Split the two meanings by state:

State Ctrl+P Ctrl+N Footer
Editor, no overlay open notes picker save and start a new note unchanged
Overlay open, input focused previous item next item ↑↓ Ctrl+N/P move

Dropping the toggle is consistent with the main window, where Escape closes the palette rather than the opening shortcut.

The command overlay's row hints should be blanked while that overlay is open, the same way the :w hint is already conditional on Vim mode.

Additional Notes

  • Mod+Enter save and Mod+Shift+P cmd work in every mode, which confirms the problem is specific to chords Vim binds.
  • The picker's Ctrl+N / Ctrl+P navigation already works correctly when the input has focus. That part needs no change.
  • This is a separate defect from Ctrl+P Closes Search Palette Instead of Navigating Up #938, which is about the main window's palette closing on Ctrl+P.

Activity

  1. uNyanda commented on Oct 14, 2026

    @uNyanda
    ContributorAuthor

    Fixed in #944

  2. self-assigned this
    on Oct 14, 2026
  3. adibhanna commented on Oct 14, 2026

    @adibhanna
    Contributor

    Fixed by #944, merged into the v2.70.0 release branch, so it ships in ZenNotes 2.70.0. In Quick capture with Vim mode on, Ctrl+P, Ctrl+N and Ctrl+W (Cmd on macOS) now work in normal and visual mode too. Inside the note picker and the command palette, Ctrl+N and Ctrl+P move the selection, and the footer says so. Thanks for the detailed report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions