-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Ctrl+Del behaviour is different from other editors #832
Comments
On Linux it's doing the same. I too would expect a ctrl+del (or ctrl+d?) to 2015-11-30 17:58 GMT-02:00 Dick van den Brink notifications@github.com:
|
Hmz, I would have thought it would do the same as it did on first line ( edit To clarify, I would expect it to remove white space only, because of my cursor position. If it was at the beginning of the word it it does remove it (like expected) |
This has been annoying me for quite a while now but I forgot to open an issue once it was published on github. The behavior is especially weird not only because it behaves differently from any other editor I know but also because it is inconsistent if you ask me. Pressing ctrl+del will delete the following word until it detects a double quote for example leaving the quote intact (ie |
This one has been irritating to me as well. IMO Sublime Text has the most sane ctrl+del behavior. That is:
In addition to its weird definition of "word" as @DerTolleEmil pointed out above, Code eats whitespace + 1 word when the next char (to the right of the caret) is whitespace (newline or not). |
+1 This is bizarre behaviour. |
I also hate it :) |
Done with b505eac. |
Thanks! Think I'm going to refresh my custom build for VSCode! Thanks again! |
@alexandrudima, I tried to build from source today and the behavior didn't match that of Visual Studio, is that by design? |
Based on a quick look at the referenced commit (b505eac) I believe the change only affects |
I adopted the new logic over multiple commits, abfaf52 adopts the new logic for
|
e.g.:
|
Ahhh got it. That actually makes good sense. |
This is not right. It's the same as the example provided by @DickvdBrink. It should not remove the |
@glen-84 The difference is 1 whitespace vs >1 whitespace. There is only 1 whitespace in this case:
and >1 whitespace in this case:
|
I understand that, but it doesn't follow the behaviour of other editors like VS and Programmer's Notepad, and is not really intuitive IMHO. Edit: And Eclipse as well. |
Here is VS:
|
@glen-84 I admittedly haven't tried it yet, but I think it makes sense... there's no reason to use use I'll try it out tomorrow, but this is my initial thoughts on it... |
I personally don't have a strong feeling about it, we can go and do what VS does, which in a way is nicer as it always deletes until the beginning of a word (not until the end of a word). |
@ctlajoie It's just easier to work with, as you don't want to have to count the spaces and then use a different key combination depending on how many there are, to avoid deleting too many characters. @alexandrudima Yes, other editors have the same behaviour, and it's more intuitive for the key combination to perform one logical action, instead of varying it. |
@alexandrudima The way VS does it isn't necessarily better if you want to delete a word to replace it with another word. |
I suggest to for now the current behaviour and get more feedback on it before changing it to the VS way. |
Then you just have to tap delete twice (while holding down ctrl). IMHO, it makes sense to follow what other editors do. Even WordPad has this behaviour. |
Given I didn't get any other negative feedback on the (new) current behaviour, I suggest to close this issue, since the initial bug is fixed. |
There's no sad face reaction. 😞 |
@glen-84 I just pushed new word commands that allow, through the use of custom To get VS-style Ctrl+Delete, edit your
This will overwrite the default:
|
Thanks @alexandrudima! =) |
See my gif; I did test this on a Windows machine with a TypeScript file
I didn't expect it to remove the
//
or the.
when pressing ctrl+delIf this is the right behaviour, feel free to close :)
The text was updated successfully, but these errors were encountered: