Markpad icon indicating copy to clipboard operation
Markpad copied to clipboard

zz in Vim-mode

Open benjaminseidler opened this issue 7 months ago • 2 comments

Is your feature request related to a problem? Please describe. In editor using vim-mode, the shortcur z-z (two times "z") does not work.

Describe the solution you'd like Vim-shortcut z-z moves the current line (with curser) to the middle of the screen.

benjaminseidler avatar Apr 10 '26 15:04 benjaminseidler

Can you confirm a couple of details for this?

  • Which platform and Markpad version are you using?
  • In Vim mode, does pressing zz do nothing, move the cursor, insert text, or trigger another command?
  • Does this happen in both split view and editor-only mode?

That should make it easier to tell whether this is a missing Monaco Vim binding or a Markpad-level shortcut/focus issue.

wargoblin avatar May 06 '26 06:05 wargoblin

Traced this to an upstream bug in monaco-vim 0.4.4 rather than anything in Markpad.

actions.scrollToCursor computes a pixel offset y and calls cm.moveCurrentLineTo(y). The adapter's moveCurrentLineTo(viewPosition) switches on the strings "top" / "center" / "bottom" and has no default branch, so a number never matches and the call silently does nothing.

It isn't only zz — zt, zb, z., z- and z<CR> are all dead for the same reason. Noted in #393 along with another Monaco-defaults problem.

PathGao avatar Aug 02 '26 21:08 PathGao