Fix context menu caret behavior when right-clicking inside a selection#1071
Merged
dail8859 merged 1 commit intoJun 8, 2026
Conversation
Owner
|
Thanks! I was not aware Scintilla had the |
Contributor
Author
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.
Fixes #780
The editor context menu had inconsistent behavior; this meant right-clicking outside a selection with the intent to act on that location would still operate on wherever the caret happened to be.
Change
MainWindow.cpp — In the
customContextMenuRequestedhandler insideaddEditor, a call toselectionFromPointnow checks whether the right-click landed inside an existing selection. If it did, the selection and caret are left untouched. If it did not,setEmptySelectionis called to move the caret to the clicked position, matching standard editor behavior.Behavior
Copy URL) is unaffected —contextMenuPosis still set before the checkManual test after the fix :
Screencast.from.2026-06-07.23-28-54.webm