Skip to content

fix: Set cursor position explicitly before jumping to the selection in paste from source feature - #2833

Open
jiishiin wants to merge 1 commit into
WerWolv:masterfrom
jiishiin:master
Open

fix: Set cursor position explicitly before jumping to the selection in paste from source feature#2833
jiishiin wants to merge 1 commit into
WerWolv:masterfrom
jiishiin:master

Conversation

@jiishiin

@jiishiin jiishiin commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Problem description

Due the cursor position change in hex editor setSelection function in commit af15427, jumping to begin or end using action buttons is not working as expected in the paste from source popup.

Implementation description

Explicitly set the cursor position before jumping to the selection.

@paxcut

paxcut commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Can you explain what you mean by it not working as expected?
The way I understand the feature is that pressing shift allows you to resume the selection and pressing ctrl-t allows you to switch from one end to the other. That appears to work correctly and you can see where the cursor is when it jumps to the other end.

@jiishiin

jiishiin commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

Can you explain what you mean by it not working as expected? The way I understand the feature is that pressing shift allows you to resume the selection and pressing ctrl-t allows you to switch from one end to the other. That appears to work correctly and you can see where the cursor is when it jumps to the other end.

This is specific to the paste from source feature I implemented. There are action buttons which can be clicked to show the begin and end of current selection using the setSelection() and jumpToSelection() api. With the commit af15427 the setSelection() will set the cursor postion to selection end. So in the feature pressing the goto begin/end was not working as expected. This change explicitly sets the cursor postion before jumping to the selection.

@jiishiin jiishiin changed the title fix: Set cursor position explicitly before jumping to the selection fix: Set cursor position explicitly before jumping to the selection in paste from source feature Aug 12, 2026
@paxcut

paxcut commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the explanation and changing the title to clarify.

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.

2 participants