-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Text input double click selects a word on all systems #2244
Conversation
Hello Kirill and thanks for pushing this! I do agree with this. I think the original "select all" behavior was implemented very early on (pre < 1.0) because it was simpler to implement, but there's no reason keeping it this way. Especially as it is redundant with CTRL+A providing a select all. My concern is that by pushing this we are making the feature more visible than it was, and it currently doesn't behave the way all user would expect in all situations.
It would be good if we can study the differences and implement something suitable? It is ok if we rely on knowledge of ASCII punctuation (aka we don't have to full-fill expectation of e.g. asian languages in a first version - we don't already - and those can be improved later based on user requests). Quick notes of some noted behaviors: Firefox (Windows)
SublimeText (Windows)
Visual Studio (Windows)
For info: |
Adding to your research: double clicking on space in chrome selects that actual space/multiple spaces as if it was a word (which kind of makes more sense to me than what the rest do but maybe I'm too used to Chrome behavior). I'll take a look into it/implementing triple click when I have more free time! |
Any update on this? Ps: Intellij Idea behaves exactly as SublimeText. Also I'd bet FF selects everything till the next |
- implemented single word double click selection (and fixed it) ocornut/imgui#2244
Once #3229 gets committed I'll be putting up a PR for this. I upgraded the system to support double, triple and (optionally) quadruple click and tried to add more consistency with the current state of text editing. You can test the latest version in my fork: https://github.com/kudaba/imgui/tree/docking, I'm still looking to get some testing on Mac to make sure it's not doing anything unexpected. |
What is supposed to do a quadruple click? |
I was testing as many different text selection systems I could get my hand on and noticed that a few of them did a select all on the 4th click so I added an option for that. I realized that text editing features does depend a bit on context, code editors don't want select all, but smaller text editors might benefit from it, and single line editors might want double click to select all instead of word. |
- implemented single word double click selection (and fixed it) ocornut/imgui#2244
0c1e5bd
to
bb6a60b
Compare
#3229 is merged now so we can easily use multiple click count, I'm looking at this now. |
…rd delimitation logic differs slightly from the one used by CTRL+arrows. (#2244)
Pushed 126a6f8
|
…rd delimitation logic differs slightly from the one used by CTRL+arrows. (ocornut#2244)
I can see the behavior of "double click to select the whole text on non-osx" was done on purpose, but I have tried various editors and text inputs on windows and they all select a word on double click.