Skip to content
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

Have cmd+backspace delete last sentence in markdown #36234

Closed
archer884 opened this issue Oct 13, 2017 · 7 comments
Closed

Have cmd+backspace delete last sentence in markdown #36234

archer884 opened this issue Oct 13, 2017 · 7 comments
Labels
*extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality markdown Markdown support issues
Milestone

Comments

@archer884
Copy link
Contributor

archer884 commented Oct 13, 2017

  • VSCode Version: Code 1.17.1 (1e9d365, 2017-10-10T14:10:17.189Z)
  • OS Version: Darwin x64 16.7.0
  • Extensions:
Extension Author (truncated) Version
vscode-markdownlint Dav 0.10.1
better-toml bun 0.3.1
gitignore cod 0.5.0
githistory don 0.2.3
python don 0.7.0
pgsql dou 0.0.8
vscode-rust kal 0.4.2
mssql ms- 1.2.0
cpptools ms- 0.13.1
csharp ms- 1.12.1
mono-debug ms- 0.15.7
PowerShell ms- 1.4.3
wordcount ms- 0.1.0
rust rus 0.3.1
vscode-table-formatter shu 1.2.1
vscode-open-in-github sys 1.6.0
gitblame wad 2.2.0
code-d web 0.16.2
debug web 0.21.2
Idris zjh 0.9.8

(6 theme extensions excluded)


Steps to Reproduce:

  1. Write a paragraph in markdown.
  2. Become unhappy with final line in paragraph.
  3. Press Cmd+Backspace to remove final line.
  4. Remember that the "final line" in Visual Studio Code is, in fact, the entire paragraph.
  5. Press Cmd+Z to bring back the paragraph.
  6. Remember that Undo, in Visual Studio Code, does not remember up to when you hit backspace, but only up to when it last arbitrarily marked your position.
  7. Rewrite half of the paragraph instead of just your last line.
  8. Curse and take another shot.

Reproduces without extensions: Yes

@vscodebot vscodebot bot added new release editor-core Editor basic functionality labels Oct 13, 2017
@mjbvz
Copy link
Collaborator

mjbvz commented Oct 13, 2017

Seems like a duplicate of #29036

@alexandrudima Can you please take a look

@alexdima
Copy link
Member

@archer884 I'm sorry for the frustration we're causing you.

You touch on two distinct problems:

  1. You would expect cmd+backspace to behave differently than it does today. cmd+backspace ("Delete All Left") is currently implemented to delete all the text on the current buffer line (i.e. all the text before the current position, until a \n is encountered). From me looking at other code editors, it appears that our built-in behaviour is consistent with what others are doing. It is not clear from your description what you would expect the built-in behaviour to be ?

  2. There is no undo stop inserted between typing and pressing cmd+backspace. I will look into fixing this.

@alexdima
Copy link
Member

@archer884 I have pushed a fix for the second problem. Please let me know what you'd like to see changed in the behaviour of cmd+backspace and the reasons for doing such a change.

@alexdima alexdima added the info-needed Issue requires more information from poster label Oct 21, 2017
@alexdima alexdima added this to the Backlog milestone Oct 21, 2017
@archer884
Copy link
Contributor Author

archer884 commented Oct 22, 2017

@alexandrudima, I would prefer that you not change the behavior of cmd+backspace because I primarily use VS Code to edit code and, under those circumstances, the current behavior is preferable.

If someone made an extension that changed that behavior for markdown files only, I might install it. :p

@alexdima
Copy link
Member

I will change the title of the issue to better reflect what's still left. I think it can be easily implemented by an extension.

@alexdima alexdima changed the title Pathological backspace + undo behavior in markdown Have cmd+backspace delete last sentence in markdown Oct 23, 2017
@alexdima alexdima added *extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality and removed editor editor-core Editor basic functionality info-needed Issue requires more information from poster labels Oct 23, 2017
@alexdima alexdima removed their assignment Oct 23, 2017
@alexdima alexdima added the markdown Markdown support issues label Oct 23, 2017
@archer884
Copy link
Contributor Author

archer884 commented Oct 24, 2017

@alexandrudima I don't want to be picky--and, like I said, just the Undo change is plenty for what was bugging me--but I thought I'd point out that the behavior I expect (probably just because I'm a programmer) is for cmd+backspace to remove the last visual line, not the last sentence.

Like, when I'm editing source code, cmd+backspace deletes all the way to the left hand margin and stops. (Naturally, this is because that's where the current buffer line started, because I have word wrap turned off when editing code.) For this reason, the behavior turns surprising all of a sudden when I have word wrap on and an entire "paragraph" disappears instead of a line. This is admittedly because usually I have word wrap off and, as a result, I have a poor mental model for what cmd+backspace actually does, but, yeah...

...Anyway, having it delete the last "sentence" would be just as surprising is all I'm saying. (In my work, at least, sentences are usually pretty long. :p)

@alexdima
Copy link
Member

Ok, I see. Then let's close this issue.

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*extension-candidate Issue identified as good extension implementation feature-request Request for new features or functionality markdown Markdown support issues
Projects
None yet
Development

No branches or pull requests

4 participants