Chore/refactor add support for multiple carets settings dialog#2
Open
NULL0B wants to merge 3 commits into
Open
Chore/refactor add support for multiple carets settings dialog#2NULL0B wants to merge 3 commits into
NULL0B wants to merge 3 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Config/ReferenceentryVSCodeKeymapNpp.iniPlugin Mode,Binding Search, andStatussectionseditor.action.insertCursorBeloweditor.action.insertCursorAboveeditor.action.cursorColumnSelectDowneditor.action.cursorColumnSelectUpdata/vscode-default-keybindings.windows.jsonsnapshot from the workflowdocs/VSCodeKeybindingCoverage.MDVSCodeKeymapNpp.dllcomctl32and updated CMake inputs for the new UI and handler sources.ideaImplementation 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