Skip to content

Add duplicate-line and scroll-without-moving-cursor shortcuts - #4254

Open
NisargJasani0602 wants to merge 1 commit into
processing:developfrom
NisargJasani0602:feat/4222-tier2-shortcuts
Open

Add duplicate-line and scroll-without-moving-cursor shortcuts#4254
NisargJasani0602 wants to merge 1 commit into
processing:developfrom
NisargJasani0602:feat/4222-tier2-shortcuts

Conversation

@NisargJasani0602

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #4222 — adds two of the "easy" tier bindings identified
in the Sublime keymap gap analysis there, per @khanniie's suggestion
to tackle that tier next.

  • Shift-Ctrl-D / Shift-Cmd-D: duplicate the current line, using
    CodeMirror's existing copyLineDown command.
  • Ctrl-Up/Down (Ctrl-Alt-Up/Down on Mac, matching Sublime's actual
    Mac binding): scroll the viewport by one line without moving the
    cursor.

Ctrl-J (join lines) is intentionally left out — it has no
CodeMirror 6 built-in and would need custom logic, so deferring it to
a smaller, separate follow-up rather than scope-creeping this PR.

Note: this PR only adds the keybindings themselves. Updating
KeyboardShortcutModal.jsx to document them (along with the broken
Replace shortcut and #4222's move-line shortcut) is tracked separately
in #4253.

Test plan

  • npm run lint passes
  • npm test -- client/modules/IDE/components/Editor passes
  • Manually verified in the running dev server: Shift-Ctrl-D
    duplicates the current line; Ctrl-Up/Down scrolls the viewport
    without moving the cursor/selection

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

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