-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
When double-clicking, please do NOT select tailing whitespaces after words #3729
Comments
This seems not to happen on Linux (Manjaro) Chrome. I am unable to reproduce this behavior. I click once into "editable":
Double clicking selects only the word and no trailing white spaces ( I believe (at least on Manjaro) this works like you described it should work. |
Yes, but unfortunately this is not the case on Windows, on which I work. I guess Slate uses the built-in functionality provided by the browsers which subtly vary on different OSes? I have checked Slate seems to have purposely overridden the Maybe Slate is just on the half way toward to another consistency where all behaviors will exclude tailing whitespaces on Windows? |
I've looked into this in the past and convinced myself this is just the way Windows is. However, I was wrong, you CAN change this in browsers (and some other apps don't behave in this way either, so it's probably not controlled by Windows, just some "platform convention"?). Sources: |
Thanks. It is nice to change that behavior of Firefox's. |
Do you want to request a feature or report a bug?
Feature
What's the current behavior?
Just take the official example (playground) as ... an example.
If I click anywhere in the word "editable", then press
ctrl + →
, the cursor will move to the end of the word.That's nice. Exactly what I want.
However, if I press
ctrl + shift + →
, the cursor will move over the white space after the word and stop at the beginning of the next word "rich".So the selection includes that whitespace.
The same thing happens if I double-click the word.
If I want to do something only with the word "editable", excluding that whitespace, I will have to press
shift + ←
to move the cursor backward and shrink the selection.Something like what?
Well, I may request or develop for a feature that when I press
shift + '
(equivalent to character"
) orshift + 9
(equivalent to character(
), a pair of double quotation marks or parentheses will enclose the selected word(s).This feature, which I like very much, is common in modern code editors.
You can imagine how annoying if I have to deal with the unwanted tailing whitespaces in the selection before I enjoy such convenient enclosing.
Slate: eh, latest?
Browser: Chrome & Firefox
OS:Windows 7
What's the proposed behavior?
I propose that when pressing
ctrl + shift + →
or double-clicking, the selection will expand to the end of the word, before the whitespace after that word.PS
I mentioned the behavior of
ctrl + →
because it differs from those in most editors, including Microsoft word as well as thecontentEditable = "true"
mode in browsers.I'm Chinese, not an English native. I'm not sure if the traditional behaviors were purposely designed so.
But I bet there probably is a good reason for Slate to have chosen this different way. And personally I prefer the latter.
Or, more smartly...
I guess a major reason for traditional behaviors is that people will often cut & paste (or drag & drop) in order to move selected word(s) to another position.
In this case, a tailing whitespace needs to be included in the selection.
Here, I have an idea that can resolve the conflict between the two use cases.
The text was updated successfully, but these errors were encountered: