Skip to content

refactor(editor): centralize CodeMirror commands and keybindings#2516

Open
bajrangCoder wants to merge 2 commits into
mainfrom
refactor/codemirror-command-keybindings
Open

refactor(editor): centralize CodeMirror commands and keybindings#2516
bajrangCoder wants to merge 2 commits into
mainfrom
refactor/codemirror-command-keybindings

Conversation

@bajrangCoder

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR centralizes CodeMirror commands and keyboard shortcuts. The main changes are:

  • Moves editor shortcuts into a shared command registry.
  • Adds shortcut normalization, priority handling, and conflict reporting.
  • Shares effective shortcuts with the terminal integration.
  • Centralizes language-server command bindings.
  • Adds custom fold-all and unfold-all commands for nested blocks.
  • Expands editor tests for commands, shortcuts, and folding.

Confidence Score: 5/5

No new blocking issue qualifies for this follow-up review.

  • No distinct unresolved production failure was found in the latest changes.
  • The updated tests cover the main command, shortcut, and nested-fold behavior.

Important Files Changed

Filename Overview
src/cm/commandRegistry.js Centralizes command execution, shortcut resolution, conflict detection, and editor keymap updates.
src/cm/foldingCommands.js Adds custom commands that discover and update nested folded ranges.
src/cm/keyBindingUtils.js Adds shared shortcut normalization and conflict checks.
src/lib/keyBindings.js Builds the shared application and CodeMirror shortcut catalog.
src/test/editor.tests.js Adds coverage for generated shortcuts, conflicts, conventional bindings, and nested folding.

Reviews (2): Last reviewed commit: "fix fold all command same line thing" | Re-trigger Greptile

Comment thread src/cm/foldingCommands.js Outdated
@bajrangCoder

This comment was marked as outdated.

@UnschooledGamer UnschooledGamer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@bajrangCoder
bajrangCoder requested a review from deadlyjack July 22, 2026 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants