question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Backspace at end of empty line doesn't delete whole line and go to end of above line

See original GitHub issue
  • VSCode Version: 1.19.2
  • OS Version: W10LTSB

Steps to Reproduce:

  1. Create a new line of a block of multi-line code like an opening div tag or JavaScript or PHP function, then hit Enter.
  2. If you have an indent, continue to step 3. If not, create an indent with Tab or 4 spaces (whatever your religion is).
  3. Hit the Backspace key; notice it merely removes an indent each time instead of deleting the whole line and putting your cursor at the end of the previous line like awesome JetBrains software does. Realize how many unnecessary keystrokes you’ll now have to deal with (and Ctrl+Shift+Up-End each line is still a lot).
  4. Continue to use VS Code because nobody can afford to buy another JetBrains license for your new job.

This should be standard logic in all editors; there’s zero functional or stylistic reason to want to just delete indents on an empty line with Backspace (unless there’s too many indents there which is rare, or your editor auto-indented wrong), and even if for some Pan-like reason you need to use that regressive space, you can just use Ctrl+Home to delete the line then indent where you want (or Shift+arrow, or just arrow if you’re a weirdo).

Does this issue occur when all extensions are disabled?: Yes

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:35
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

16reactions
vasilev-alexcommented, Dec 22, 2018

That is something that should be implemented natively in VS Code. But for now I found this extension really useful https://marketplace.visualstudio.com/items?itemName=jasonlhy.hungry-delete

Saves up hours a day 😃

2reactions
rmunncommented, Feb 14, 2018

I like this feature idea, but one other thing to think about is the interaction with the editor.trimAutoWhitespace setting. If editor.trimAutoWhitespace is false, then I might want to delete some whitespace after hitting Enter, while still keeping the new line. And in those situations, reaching for the Backspace key would feel like the most natural way to do it.

So if this is implemented, I’d like to see a setting to turn it off for the rare cases when I might actually need to backspace over some auto-inserted whitespace (e.g., if I’ve turned editor.trimAutoWhitespace off for some reason).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Backspace won't delete a line in Word 2016
Hello, Recently, Word has started to act strangely: When I press ENTER to end the current line, the cursor goes down (normally), ...
Read more >
Vim - Delete blank line using backspace in insert mode
When my cursor is placed at the start of an empty line and I press the backspace key while in insert mode, I'd...
Read more >
JetBrains Rider - Add, delete, and manipulate lines
One way to delete a line is to select the whole line and press Delete or Backspace, but a slightly more efficient way...
Read more >
Backspace and delete problems | Vim Tips Wiki - Fandom
Backspace key won't move from current line. Backspace works in Insert mode (e.g. not inserting a ^?), but won't delete over line breaks, ......
Read more >
How to Delete a Blank Page in Word - Lifewire
Press the delete/backspace key on the keyboard until you've deleted every blank line and the entire blank page is gone.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found