add option to disable cmd-click to jump to definition #4466

Closed
antoineschmitt opened this Issue May 11, 2016 · 9 comments

Comments

Projects
None yet
3 participants
@antoineschmitt

Hi,
I use cmd-C and cmd-V a lot when writing code. Actually, my finger is often still/already on the cmd key when I (double-)click on a variable or function name to select it.
But in the processing editor, cmd-click on a name jumps to its definition. So I end up very often jumping to the definition of a variable or function when I actually just wanted to select it.
This is a real burden.
Strangely, it seems that it only happens since I just updated to 3.1.
Is this a bug ?
Alternatively, is there a way to disable this behavior in the Processing preferences ? I looked in the preferences.txt file but did not find anything.
Thanks

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 11, 2016

Member

Yes, that's a bug. Jump to definition should be ctrl-click on the Mac.

@JakubValtar this is a serious regression for Mac users.

Member

benfry commented May 11, 2016

Yes, that's a bug. Jump to definition should be ctrl-click on the Mac.

@JakubValtar this is a serious regression for Mac users.

@benfry benfry added the critical label May 11, 2016

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar May 11, 2016

Contributor

Sorry about that. I'll iron it out asap.

Contributor

JakubValtar commented May 11, 2016

Sorry about that. I'll iron it out asap.

@antoineschmitt

This comment has been minimized.

Show comment
Hide comment
@antoineschmitt

antoineschmitt May 11, 2016

Attention : ctrl-click on Mac can be used for right-clicking.
See #3242
After which ctrl-click was disabled on Mac, and cmd-click enabled, or so it seems (may 19 2015).
Which does not explain why I'm only getting this weird behavior only lately…
My advice would be to do the "jump-to-definition" only if cmd-clicking on a word that is already selected.

Attention : ctrl-click on Mac can be used for right-clicking.
See #3242
After which ctrl-click was disabled on Mac, and cmd-click enabled, or so it seems (may 19 2015).
Which does not explain why I'm only getting this weird behavior only lately…
My advice would be to do the "jump-to-definition" only if cmd-clicking on a word that is already selected.

@benfry benfry removed the critical label May 11, 2016

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 11, 2016

Member

Ugh, sorry @JakubValtar, I misread/misspoke. Jump should be cmd-click on Mac, ctrl-click is for right-click.

We could add a preference to remove the behavior, though most people want the default behavior. The behavior can probably be shut off easily, so let's just put the preference in preferences.txt but not add it to the prefs window.

Member

benfry commented May 11, 2016

Ugh, sorry @JakubValtar, I misread/misspoke. Jump should be cmd-click on Mac, ctrl-click is for right-click.

We could add a preference to remove the behavior, though most people want the default behavior. The behavior can probably be shut off easily, so let's just put the preference in preferences.txt but not add it to the prefs window.

@benfry benfry added the enhancement label May 11, 2016

@benfry benfry changed the title from cmd-click on Mac in editor is a burden to add option to disable cmd-click to jump to definition May 11, 2016

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar May 11, 2016

Contributor

Sounds good, but I still want to do some tweaks because the interaction doesn't feel right.

Contributor

JakubValtar commented May 11, 2016

Sounds good, but I still want to do some tweaks because the interaction doesn't feel right.

@antoineschmitt

This comment has been minimized.

Show comment
Hide comment
@antoineschmitt

antoineschmitt May 11, 2016

I confirm that this did not happen in 3.0.2 (the jump-to-definition behavior was altogether not implemented).
I reiterate my suggestion : implement the behavior only when the click happens on a word that is already selected. I think that this would please everyone...
Cheers !

I confirm that this did not happen in 3.0.2 (the jump-to-definition behavior was altogether not implemented).
I reiterate my suggestion : implement the behavior only when the click happens on a word that is already selected. I think that this would please everyone...
Cheers !

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 11, 2016

Member

The current/intended behavior is the same as I've seen in any other editor (actually, with Eclipse you have to move the mouse slightly after hitting cmd so that it underlines the text first), so no, I don't think that would please everyone.

Member

benfry commented May 11, 2016

The current/intended behavior is the same as I've seen in any other editor (actually, with Eclipse you have to move the mouse slightly after hitting cmd so that it underlines the text first), so no, I don't think that would please everyone.

@antoineschmitt

This comment has been minimized.

Show comment
Hide comment
@antoineschmitt

antoineschmitt May 11, 2016

Ok.
Actually, after using it a bit more, it happened once that the editor thought that the cmd key was down whereas it was actually not (any more). In this state, whenever I clicked on any word, it jumped to its definition.
I think that there is a quirk in the code where the cmd-down flag is not reset fast enough or always properly. Which would account for the number of times where it jumps-to-definition when not intended, which is often.

Ok.
Actually, after using it a bit more, it happened once that the editor thought that the cmd key was down whereas it was actually not (any more). In this state, whenever I clicked on any word, it jumped to its definition.
I think that there is a quirk in the code where the cmd-down flag is not reset fast enough or always properly. Which would account for the number of times where it jumps-to-definition when not intended, which is often.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar May 11, 2016

Contributor

Yeah, I noticed too and I'm working on a fix.

Contributor

JakubValtar commented May 11, 2016

Yeah, I noticed too and I'm working on a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment