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

Auto edit delimiters should cancel sooner #2395

Closed
cgchoffman opened this Issue Mar 10, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@cgchoffman
Member

cgchoffman commented Mar 10, 2017

Short Summary

I know a fix just went in to resolve this but i personally think it could be cancelled sooner. Right now the only time the double cursor is disabled is if I hold Shift and continue the selection in the original direction. Any other key movement, with or without shift will keep the double cursor enabled.

I think the second cursor should be gone as soon as the cursor leaves the initial delimiter

Steps to Reproduce

Sample text:
aaaaaa|"bbbbbbb"cccccc

  1. Place cursor at |
    Holding shift, press right twice. The second cursor will appear then disapear on the second press

  2. Place cursor at |
    Holding shift ,press right once, then left. The second cursor remains. It should be gone. The thing happens if you release Shift before you press left. It should be gone in that case too.

  3. Place cursor at |
    Hold shift and press right once. Release Shift and press right again. The second cursor remains. It should be gone.

Let me know if you want a gif for these.

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Mar 10, 2017

Hmm. This is a feature of Scintilla. When you have multiple carets (no matter how they were created), any arrow keys will move all carets. While I agree in theory with what you expect to happen, programatically detecting this scenario may be tricky, or at least not very efficient (performing a check every single time the cursor is moved).

The workaround is to press Escape.

@Naatan

This comment has been minimized.

Member

Naatan commented Mar 10, 2017

I think we could simply monitor the next keypress, if it doesnt have a value (JS can tell you the "value" of a keypress) then we cancel the multi-caret. Stuff like left arrow, shift left arrow, etc. should not have a value.

I can look into this if you like @mitchell-as? Seems at this point it's mainly a matter of interpreting events. I think the scintilla specific stuff has been handled, unless you have another idea?

@Naatan Naatan added this to the 10.2.1 milestone Mar 10, 2017

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Mar 10, 2017

@Naatan go for it. I wouldn't know where to begin.

@Naatan Naatan assigned Naatan and unassigned mitchell-as Mar 10, 2017

@Naatan

This comment has been minimized.

Member

Naatan commented Mar 10, 2017

Can you link me to the logic for this? As well as the logic for HTML tag editing, since we'd want the behavior for that to be the same.

@mitchell-as

This comment has been minimized.

Member

mitchell-as commented Mar 10, 2017

Both bits of logic are in views-editor.p.xml's "onUpdateUI" method.

@Naatan Naatan modified the milestones: 10.2.1, 10.2.2 Mar 14, 2017

@Naatan Naatan closed this in 3a85104 Mar 24, 2017

Naatan added a commit that referenced this issue Mar 24, 2017

Editor: Auto edit delimiters now cancels sooner - fixes #2395
rn=

(integrated from the KomodoIDE master branch change 5e5b8a6a41 by Nathan Rijksen <n.rijksen@gmail.com>)

Komodo/KomodoIDE@5e5b8a6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment