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

Shift+del should delete line only when empty selection, otherwise clipboard cut #5973

Closed
prof7bit opened this issue Dec 13, 2017 · 2 comments

Comments

@prof7bit
Copy link

Description of your problem

What steps will reproduce the problem?

  1. select some text
  2. press shift-del

What is the expected output? What do you see instead?
selected text should be removed and inserted to clipboard so that shift-ins brings it back. (cut & paste)

instead it just deletes all lines that were part of the selection and one line more without putting any of it to the clipboard.

proposed solution:

  • when the selection is empty then delete the line and put it to the clipboard
  • when the selection is not empty then fall back to the standards conforming behavior of cut exactly the selected text to the clipboard.

Generally it should be expected that after the sequence shift-del, shift-ins the text should be in the same state as it was before, as it is in any other code editor out there.

Many people wo use both hands on the keyboard use these keys as a replacement for the alternative Crtl-X, Ctrl-V because when selecting text with the keyboard (shift and cursor keys) instead of using the mouse then the left hand is already sitting on the shift key while the right index finger is conveniently near del and ins.

When not using it for cutting selected text and instead just deleting the current line without a selection then it should be put to the clipboard anyways, as this is also standard practice in many code editors that have line delete function, there is a corresponding paste key that brings back the line. In spyder it is just lost, not useful when rearranging lines.

Please do not close this bug too quickly, if nobody wants to work on this then I might give it a try myself, this odd behavior of spyder has caused me so much annoyance already I really want to find a solution to make the standard keys behave more standards conforming.

@ccordoba12
Copy link
Member

This is a good proposal, thanks. Please send us a pull request if you want to see this implemented in a future release because we don't have time to do it.

@ccordoba12
Copy link
Member

@csabella, maybe you'd like to work on this one?

@ccordoba12 ccordoba12 modified the milestones: wishlist, v3.2.x Dec 13, 2017
@csabella csabella self-assigned this Dec 14, 2017
@ccordoba12 ccordoba12 modified the milestones: v3.2.x, v3.2.6 Dec 28, 2017
@ccordoba12 ccordoba12 changed the title shift-del delete line only when empty selection, otherwise clipboard cut Shift+del should delete line only when empty selection, otherwise clipboard cut Dec 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants