Skip to content

Restore Replace shortcut and document Move Line in shortcuts modal - #4255

Open
NisargJasani0602 wants to merge 1 commit into
processing:developfrom
NisargJasani0602:docs/4253-shortcuts-modal-sync
Open

Restore Replace shortcut and document Move Line in shortcuts modal#4255
NisargJasani0602 wants to merge 1 commit into
processing:developfrom
NisargJasani0602:docs/4253-shortcuts-modal-sync

Conversation

@NisargJasani0602

Copy link
Copy Markdown
Contributor

Summary

Partial fix for #4253 (keyboard shortcuts modal out of sync with actual
keybindings). Covers two of the items identified there:

  • Restored the Replace shortcut (Ctrl+H on Windows/Linux, Cmd+Alt+F on Mac — matching Sublime and the pre-CM6 config). This was a genuine regression from the CM5 -> CM6 migration, not just a documentation gap: the old editor explicitly bound this via CM5's replace command, and the modal already advertised the correct platform-specific combo, but nothing implemented it. Fixed by wiring it to CodeMirror 6's openSearchPanel, whose panel already includes Replace/Replace All fields built in.
  • Added Move Line Up/Down to the shortcuts modal (from CTRL+SHIFT+UP no longer moves lines #4222, already merged, just never documented).

Scope note

While auditing the modal against the actual keymap, I found several more real gaps (a phantom "Comment Line" shortcut that isn't implemented, and several working-but-undocumented shortcuts like select-next-occurrence, multi-cursor, delete-line, go-to-line, etc).
Keeping those out of this PR to stay reviewable — tracking as a follow-up.

Test plan

  • npm run lint passes
  • npm test -- client/modules/IDE/components/Editor passes
  • Manually verified in the running dev server: Cmd+Alt+F opens
    the search panel with Replace fields; the modal shows the new
    Move Line Up/Down entries

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

@NisargJasani0602

Copy link
Copy Markdown
Contributor Author

Quick note before this gets reviewed — I want to flag something I noticed after implementing this.

Ctrl+F (already bound to openSearchPanel) opens the same search panel that already includes the Replace field and buttons built in — there's no separate "replace mode" in CodeMirror 6's search UI. So the Ctrl+H/Cmd+Alt+F binding added here doesn't unlock any new functionality; it's just an additional key combo that calls the exact same openSearchPanel function Ctrl+F already calls.

I still think there's a reasonable case for keeping it (it restores what the pre-CM6 editor explicitly had, and the shortcuts modal has been advertising a dedicated Replace shortcut since before I touched anything, so this closes a documented promise), but it's also fair to call it redundant — one keystroke away either way, and the Mac binding (Cmd+Alt+F) is a little awkward specifically because Cmd+H is OS-reserved.

Two ways to go from here:

Keep this PR as-is (dedicated Replace shortcut).
Simplify instead — drop the separate shortcut, and just document Ctrl+F as "Find / Replace" in the modal, since it already covers both.
Happy to go either way — let me know your preference and I'll adjust.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant