Restore Replace shortcut and document Move Line in shortcuts modal - #4255
Restore Replace shortcut and document Move Line in shortcuts modal#4255NisargJasani0602 wants to merge 1 commit into
Conversation
|
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). |
Summary
Partial fix for #4253 (keyboard shortcuts modal out of sync with actual
keybindings). Covers two of the items identified there:
Ctrl+Hon Windows/Linux,Cmd+Alt+Fon 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'sreplacecommand, and the modal already advertised the correct platform-specific combo, but nothing implemented it. Fixed by wiring it to CodeMirror 6'sopenSearchPanel, whose panel already includes Replace/Replace All fields built in.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 lintpassesnpm test -- client/modules/IDE/components/EditorpassesCmd+Alt+Fopensthe search panel with Replace fields; the modal shows the new
Move Line Up/Down entries
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #123