Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Unexpected Ctrl + Del behaviour #3362

Closed
aerouk opened this issue Aug 22, 2014 · 33 comments
Closed

Unexpected Ctrl + Del behaviour #3362

aerouk opened this issue Aug 22, 2014 · 33 comments

Comments

@aerouk
Copy link

aerouk commented Aug 22, 2014

In other programs, pressing Ctrl + Del on the end of a line would delete newline characters and bring the next line after the cursor.

Example in Sublime Text:

(https://s.kpvp.in/gifs/WfVaC.gif)

@izuzak
Copy link
Contributor

izuzak commented Aug 22, 2014

@aerouk Which OS and Atom version are you using? What happens when you hit ctrl+del? Nothing or you get an error? Can you reproduce this in safe mode?

@aerouk
Copy link
Author

aerouk commented Aug 22, 2014

@izuzak Oops, forgot to give that info.

OS: Windows 7 x64
Atom Version: 0.123.0

When I press Ctrl+Del in the middle of a line, it behaves as expected. But at the end of a line, it just deletes the line below straight away, even in safe-mode.

@izuzak izuzak added the windows label Aug 23, 2014
@YemSalat
Copy link

YemSalat commented Oct 2, 2014

+1, if I understood you correctly I am experiencing the same issue

In Sublime text pressing Ctrl + Del (or backspace) will remove all whitespace and stop when it hits either a newline or non-whitespace character. Atom does not stop on non-whitespace characters and removes them as well which is very annoying after you are used to Sublime's behaviour (I think most editors out there are same as ST)

For example I have the following text (the pipe symbol is representing the cursor):

(function foo() {
  // hello world
})();
|

Now if I press Ctrl + Del in ST I will have this:

(function foo() {
  // hello world
})();|

While Atom does this:

(function foo() {
  // hello 
|

Removing the whole line above is a much rarer use case then removing whitespace, plus on Linux you can use backspace/del to remove all whitespace backward/forward which is very handy (if you press it again it will remove everything until the next newline character giving same result as atom).
There are many other ways to remove the whole line of text, I think Ctrl + Del behaviour should match that of Sublime Text.

@YemSalat
Copy link

YemSalat commented Oct 2, 2014

This is not a windows-only issue.

@kevinsawicki kevinsawicki added bug and removed windows Issues that occur on Windows but not on other platforms. more-information-needed labels Oct 2, 2014
@kevinsawicki
Copy link
Contributor

@YemSalat Thanks for providing more details, I've updated the labels

@jhasse
Copy link
Contributor

jhasse commented Jun 2, 2015

I think #4026 is a duplicate of this.

@aerouk
Copy link
Author

aerouk commented Jun 5, 2015

@jhasse that issue does show the exact problem I was having, haven't tested the fix that user got merged though

@dwelle
Copy link
Contributor

dwelle commented Jul 2, 2015

As mentioned in #4026, you can rebind via:

'.editor':
    'ctrl-backspace': 'editor:delete-to-previous-word-boundary'
    'ctrl-delete': 'editor:delete-to-next-word-boundary'

@glen-84
Copy link

glen-84 commented Nov 6, 2015

Atom                    delete-to-end-of-word
Brackets                delete-to-next-word-boundary
Eclipse                 delete-to-next-word-boundary
Programmer's Notepad    delete-to-next-word-boundary
Sublime Text            delete-to-next-word-boundary
Visual Studio 2015      delete-to-next-word-boundary
Visual Studio Code      delete-to-next-word-boundary

Spot the odd one out.

Please change the default.

@YemSalat
Copy link

YemSalat commented Nov 7, 2015

I also think that the default needs to be changed. In #4026 it is justified by the fact that this behavior "is similar to most text boxes on your system"
But that is exactly why I don't write code in text boxes and if I ever have to - I miss my editor at those times and one of the things I miss is exactly removing only whitespace on Ctrl+Backspace/Del

I do not think that Atom should be copying other editors, but this is not "copying" - this is complying with common code editor logic.

@lucasvw
Copy link

lucasvw commented Nov 16, 2015

👍 change the default

@jims
Copy link

jims commented Dec 14, 2015

👍 This is probably my nr 1 grief with text editing in atom!

@DKhalil
Copy link

DKhalil commented Dec 29, 2015

This is so incredibly annoying, +1

@splintor
Copy link

splintor commented Jan 4, 2016

👍

@westtrade
Copy link

👍

1 similar comment
@efkan
Copy link

efkan commented Jan 23, 2016

+1

@zenbaku
Copy link

zenbaku commented Feb 9, 2016

+1, number one reason to keep going back to sublime.

@denisazevedo
Copy link

+1

@glen-84
Copy link

glen-84 commented Mar 13, 2016

@denisazevedo You can use reactions now, instead of +1 comments.

Edit: I see that you have in some cases.

@luisaceituno
Copy link

PLEASE change this default so I don't need to configure the keybindings on every new machine.

@ilkome
Copy link

ilkome commented Apr 23, 2016

+1

@elliottjro
Copy link

elliottjro commented Jul 5, 2016

I dont suppose we have any progress to this? It has been 2 years T_T

ps I am more than willing to work on this if someone can point me in the right direction

@YemSalat
Copy link

YemSalat commented Jul 5, 2016

Just submitted a PR to fix this: #12098

@DavidEichmann
Copy link

+1 trying out Atom after using Sublime. The current delete-to-end-of-word behavior was unexpected/undesirable for me.

@QueueHammer
Copy link

I have been using Atom for about 6 months now, and this is still my most unfavorite feature. I have see a couple of these threads that eventually point to a PR that end the same way it did. Closed; without a merge. @glen-84 summed it up best with his comment. If this doesn't change soon I'll have to take break back to Brackets, while I know others who will go to VS Code (shudder).

@abumalick
Copy link

An easy fix for getting the sublime text behavior for CTRL-BACKSPACE and CTRL-DELETE :
Click File / Keymap
Add this at the end of your keymap.cson :

'atom-workspace atom-text-editor':
  'ctrl-backspace': 'editor:delete-to-previous-word-boundary'
  'ctrl-delete': 'editor:delete-to-next-word-boundary'

@abumalick
Copy link

Well, there is still a thing that don't work like sublime text.
CTRL-DELETE before a CR (Carriage return) don't delete the CR.

@dwelle
Copy link
Contributor

dwelle commented May 10, 2017

@abumalick CTRL-DELETE before a CR (Carriage return) don't delete the CR.

I think we had to migrate our whole codebase to LF line endings because of this ;) (which we should have done anyway)

@lynnellneri
Copy link

lynnellneri commented Jan 23, 2018

Hello. I also face this issue. Ctrl+Delete deletes the whole line instead of just the white space. The same thing with Ctrl+Backspace. Atom version 1.23.3

Update upon reading #4026 (comment) I've found out that I just have to include his comment into the config and yey, there's working (I used ctrl instead of alt).

@vanboom
Copy link

vanboom commented Jun 27, 2018

Thank you, please make this the default.

@cxai
Copy link

cxai commented Jun 28, 2018

Pretty please?

@stale
Copy link

stale bot commented Jun 28, 2019

Thanks for your contribution!

This issue has been automatically marked as stale because it has not had recent activity. Because the Atom team treats their issues as their backlog, stale issues are closed. If you would like this issue to remain open:

  1. Verify that you can still reproduce the issue in the latest version of Atom
  2. Comment that the issue is still reproducible and include:
    • What version of Atom you reproduced the issue on
    • What OS and version you reproduced the issue on
    • What steps you followed to reproduce the issue

Issues that are labeled as triaged will not be automatically marked as stale.

@stale stale bot added the stale label Jun 28, 2019
@stale stale bot closed this as completed Jul 12, 2019
@lock
Copy link

lock bot commented Jan 8, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. If you can still reproduce this issue in Safe Mode then please open a new issue and fill out the entire issue template to ensure that we have enough information to address your issue. Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests