Repository navigation
Quick Capture Shortcuts Are Dead In Normal And Visual Mode #942
Description
- 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
- Turn on Vim mode.
- Open the Quick capture window.
- Press
Escapeso the editor is in normal mode. - Press
Ctrl+N. - Observe that nothing happens and the cursor moves down instead.
- Press
Ctrl+P. - Observe that nothing happens and the cursor moves up instead.
- Press
Ctrl+W. - Observe that the window does not close and the window command prefix engages.
- Press
ito enter insert mode, then repeat steps 4 and 6. - 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:
- Global Shortcuts should trample Vim Mode shortcuts consistently or in an explainable way. #510 moved the palette shortcut into a capture-phase handler so
Ctrl+Pwins over Vim's cursor-up. - Opening wrong folder on start and keybinds not working #579 recorded that a shortcut "remapped onto an editor chord (Ctrl+P, Ctrl+E, …), the bubble-phase handler ran only after CodeMirror had already consumed the key, so the shortcuts went dead exactly when the editor held focus."
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+NandCtrl+Pas 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+EnterandMod+Shift+Pare 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+Entersave andMod+Shift+Pcmd work in every mode, which confirms the problem is specific to chords Vim binds.- The picker's
Ctrl+N/Ctrl+Pnavigation already works correctly when the input has focus. That part needs no change. - This is a separate defect from
Ctrl+PCloses Search Palette Instead of Navigating Up #938, which is about the main window's palette closing onCtrl+P.
Activity
uNyanda commentedon Oct 14, 2026
Fixed in #944
adibhanna commentedon Oct 14, 2026
Fixed by #944, merged into the
v2.70.0release branch, so it ships in ZenNotes 2.70.0. In Quick capture with Vim mode on,Ctrl+P,Ctrl+NandCtrl+W(Cmdon macOS) now work in normal and visual mode too. Inside the note picker and the command palette,Ctrl+NandCtrl+Pmove the selection, and the footer says so. Thanks for the detailed report.