Skip to content

Chore/refactor add support for multiple carets settings dialog#2

Open
NULL0B wants to merge 3 commits into
14ag:mainfrom
NULL0B:chore/refactor-add-support-for-multiple-carets-settigns-dialog
Open

Chore/refactor add support for multiple carets settings dialog#2
NULL0B wants to merge 3 commits into
14ag:mainfrom
NULL0B:chore/refactor-add-support-for-multiple-carets-settigns-dialog

Conversation

@NULL0B

@NULL0B NULL0B commented May 1, 2026

Copy link
Copy Markdown

Summary

First, sorry for the size of this refactor. I know it is not small.

A big part of the motivation came from my own needs as a VS Code-first user, but my goal was not to fork this into a separate project or take it in a different direction just for myself. I wanted to contribute those improvements back here, in the main project, so the work could stay aligned with the existing codebase and hopefully be useful to other users as well.

This PR replaces the old toggle/summary plugin surface with a single Config/Reference dialog and expands the plugin's VS Code parity for multi-cursor editing.

The new dialog embeds the generated VS Code binding reference directly in the DLL, supports live filtering, and allows plugin-handled bindings to be enabled or disabled individually. Those selections are persisted in the plugin INI and are respected by runtime shortcut and chord interception.

This PR also adds missing cursor behaviors such as insert cursor above/below and column selection up/down, while refactoring action execution into dedicated handler modules to keep the runtime path more maintainable.

Feel free to close this no hard feelings :)

What Changed

  • replaced the two plugin menu commands with one Config/Reference entry
  • added a Win32 config/reference dialog backed by embedded generated binding data
  • added a searchable list-view with per-binding checkboxes
  • added a single top-level enable/pass-through toggle
  • persisted global mode and per-binding selections in VSCodeKeymapNpp.ini
  • gated runtime shortcut and chord handling on saved binding selections
  • improved the dialog layout with grouped Plugin Mode, Binding Search, and Status sections
  • updated the status text so it reads like UI state instead of loose explanatory text
  • refactored action execution into dedicated handler modules
  • added support for editor.action.insertCursorBelow
  • added support for editor.action.insertCursorAbove
  • added support for editor.action.cursorColumnSelectDown
  • added support for editor.action.cursorColumnSelectUp
  • added shared vertical movement logic for multi-cursor and column-selection flows
  • added configurable virtual-space handling support in the cursor logic
  • updated the sync script to generate embedded reference metadata and runtime tables
  • added support for manifest-only bindings during generation
  • preserved manifest ordering in generated output
  • removed the generated data/vscode-default-keybindings.windows.json snapshot from the workflow
  • refreshed docs/VSCodeKeybindingCoverage.MD
  • updated contributor and README documentation to match the new flow
  • simplified release packaging to ship only VSCodeKeymapNpp.dll
  • linked comctl32 and updated CMake inputs for the new UI and handler sources
  • ignored .idea

Implementation Notes

Dialog and settings

The old toggle/summary workflow is replaced by a single configuration dialog that shows the generated reference data line by line in a list-view. Users can filter the list, review the mapped status, and opt individual handled bindings in or out.

The plugin mode and row selections are saved in the plugin config directory and reused on startup. When the plugin is set to pass-through mode, the saved row selections are preserved and become active again when strict handling is re-enabled.

Runtime handling

Shortcut and chord interception now consult the saved reference index state before executing an action. This makes the runtime behavior match the configuration dialog exactly.

The action dispatch path was also split into smaller handler files so cursor movement, comment behavior, folds, line editing, and scrolling are easier to evolve independently.

Generated data and packaging

The sync script now generates embedded reference metadata directly into the C++ include instead of producing a separate JSON snapshot. It also supports manifest-only bindings, preserves manifest order, and refreshes the coverage report from the same source of truth.

Because the dialog now reads compiled-in reference data, release packaging was simplified to a DLL-only artifact.

AI USAGE:

I did use AI for this refactor, I also reviewed it and tested it against vscode

NULL0B added 3 commits May 1, 2026 18:57
…pport

Replace the old toggle and summary flow with a single Config/Reference dialog
that embeds the generated VS Code binding catalog directly in the plugin DLL.

Add a searchable list-view with per-binding checkboxes so handled shortcuts can
be enabled or disabled individually, while keeping a single top-level plugin
mode toggle for strict handling versus pass-through behavior.

Persist both the global enabled state and per-binding selections in the plugin
INI file, and gate shortcut/chord interception on those saved selections so the
runtime behavior matches the dialog configuration.

Refactor shortcut execution into dedicated handler modules and add support for
VS Code-style insert-cursor-above/below and column-selection up/down actions,
including shared vertical movement logic and virtual-space handling.

Update the keybinding sync pipeline to:
- generate embedded binding reference metadata
- preserve manifest order
- support manifest-only bindings
- stop emitting the intermediate JSON snapshot

Refresh generated coverage data and docs to match the new flow, and simplify
release packaging to ship only VSCodeKeymapNpp.dll now that the plugin no
longer depends on external generated reference files.

Also:
- register a single `Config/Reference` plugin command
- improve the dialog layout with grouped mode/search/status sections
- link `comctl32` for the list-view UI
- ignore `.idea`
Pause shortcut interception while modal plugin dialogs are open so Config/Reference and About input is not consumed by the editor hook.

Persist disabled binding settings with a stable command+key identity while still accepting legacy numeric entries, preventing regenerated binding tables from remapping saved user preferences.

Also fix the dialog summary to count only configurable bindings and tighten insert-cursor deduping so it matches full selection state instead of any caret on the same line.
Route Shift+Alt+Down and Shift+Alt+Up through custom handlers so copy-line behavior leaves the caret in the duplicated line for empty selections.

Update the keybinding manifest and regenerate the embedded bindings and coverage report so the generated runtime tables stay aligned with the new custom action.
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