Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DisAsm: double-click and tripple-click should select text at cursor. #3252

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

Kaldesyvon
Copy link

Your checklist for this pull request

Detailed description

I have implemented new feature for disassembly view. You can now double click to select word and triple click to select whole line, like most editor have this feature nowadays. It is now easier to select text and copy it. This does not eliminate feature to jump to address. You can do it by holding down Ctrl key and double click on address.

Test plan (required)

To test it just open disassembly view and double click or triple click on line. You can copy text with Ctrl + C. Also test double click on address or name of function that call instruction calls. You are able to select it now. Hold down Ctrl and double click on address or function name and you will be redirected to that address.

Closing issues

closes=#3097

@ITAYC0HEN
Copy link
Member

Hey @Kaldesyvon and welcome to Cutter :) Thank you for this contribution!
Personally, I am not in favor of double-clicking to select a word, as it changes the standard of double-clicking to jump to an address. What I suggest, which might already be implemented, is to take advantage of the fact that a single left click highlights a token, and implement an additional feature - that ctrl+c will copy this selected token\word.
This is common behavior in different RE software.

What do others think?

@ret2libc
Copy link
Member

Hey @Kaldesyvon and welcome to Cutter :) Thank you for this contribution! Personally, I am not in favor of double-clicking to select a word, as it changes the standard of double-clicking to jump to an address. What I suggest, which might already be implemented, is to take advantage of the fact that a single left click highlights a token, and implement an additional feature - that ctrl+c will copy this selected token\word. This is common behavior in different RE software.

What do others think?

I do agree with @ITAYC0HEN .

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

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

Sorry, pressed the wrong button. Yes, lets go with the solution @ITAYC0HEN suggested.

@Kaldesyvon
Copy link
Author

Thank you for responses, but I have two more questions:

  1. Should I still consider triple click to select line?
  2. Should I add functionality to select multiple words/tokens by holding mouse button and moving cursor to other offset?

@karliss
Copy link
Member

karliss commented Nov 1, 2023

  1. Should I add functionality to select multiple words/tokens by holding mouse button and moving cursor to other offset?

I would leave he default text field selection behavior as is. Not being able to select the exact range I want seems more annoying, than the minor convenience of selecting whole words when that's what I want.

There is potential room for improving the selection behavior to support mainting selection after scrolling and even selecting wider range than being displayed. But that's a lot more complicated task that should be done in a separate issue.

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.

None yet

5 participants