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

Introduce Ctrl+D/Cmd+D temporary overwriting for find widget toggles #36682

Merged
merged 8 commits into from
Oct 23, 2017

Conversation

alexdima
Copy link
Member

@alexdima alexdima commented Oct 21, 2017

Fixes #8869

Ctrl+D temporary overwriting of the find widget toggles

  • only when starting with a collapsed selection on a word, Ctrl+D will override the find widget flags: wholeWords: true, matchCase:true, isRegex: false.
  • for as long as Ctrl+D is pressed again, continuously, those flags will remain the effective search flags.
  • if a find widget toggle is explicitly changed (e.g. pressing alt+w or alt+c or clicking on a toggle), or if editor focus is lost, or if the selection changes explicitly, the overrides will be reset.

@alexdima alexdima self-assigned this Oct 21, 2017
@alexdima alexdima changed the title Introduce Ctrl+D/Cmd+D temporary disassociation from the find widget toggles [WIP] Introduce Ctrl+D/Cmd+D temporary disassociation from the find widget toggles Oct 21, 2017
@alexdima
Copy link
Member Author

alexdima commented Oct 23, 2017

Some flows:

  • in all cases the selection highlighter shows what Ctrl+D will do next

Find widget closed - starting with a collapsed selection

  • Ctrl+D uses wholeWords: true and caseSensitive: true
  • the find options are briefly shown to reflect the temporary overriden settings
    0-0

Find widget closed - starting with a non-collapsed selection

  • Ctrl+D uses the find options
  • the find options are briefly shown
    0-1

Find widget opened - starting with a collapsed selection

  • Ctrl+D uses wholeWords: true and caseSensitive: true
  • the find options reflect the temporary overriden settings
  • as soon as the editor loses focus, the find options rollback to their pre-Ctr+D values.
    1-0

Find widget opened - starting with a non-collapsed selection

  • Ctrl+D uses the find options
    1-1

@alexdima alexdima changed the title [WIP] Introduce Ctrl+D/Cmd+D temporary disassociation from the find widget toggles Introduce Ctrl+D/Cmd+D temporary overwriting for find widget toggles Oct 23, 2017
@alexdima alexdima merged commit 97b51c5 into master Oct 23, 2017
@alexdima alexdima deleted the alex/ctrl-d-improvements branch October 23, 2017 13:00
@innerlee
Copy link
Contributor

find options are briefly shown

I find the options quite useful but their lives are too short. They always disappear when I want to click on them. Could these buttons be available at the status bar? If this request makes sense, then I will mv it to a issue.

@alexdima
Copy link
Member Author

alexdima commented Oct 27, 2017

@innerlee I would not add any extra space for them. The reason for them popping up (only when doing ctrl+D or ctrl+shift+L) is to provide a bit of visual explanation of the used searched settings in the case when the find widget is closed. I would not want to waste any permanent screen estate on those. We can increase their timeout, but they're mostly a quick reminder guide (in the case the find widget is closed).

Perhaps printing something in the status bar would serve the same purpose.

@innerlee
Copy link
Contributor

I reconsidered the request to be not that useful. 99% of the case when I want to click the transient buttons is to set match cases to true. With the change of this pr, I do not need to care about their status most of the time.
But yeah, increase a little timeout will be good :)

@DaltheCow
Copy link

DaltheCow commented Nov 20, 2019

When I click on the 'Abl' or 'Aa' section I intend to turn that feature off until I turn it back on manually. Is there a way to make this remember that I don't want whole word match on? Because I often I don't want whole word match on when I'm using this. I ask because I haven't found an alternative for osx yet. I guess windows has alt + c or whatever.

I just found that if I double click the word, then do command + D, it does what I want. But if I put the cursor in a word, then do command + D, then do command + D again, it always has whole word match on, even if I turn it off it comes right back.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ctrl+D should match whole words instead of substrings
4 participants