-
Notifications
You must be signed in to change notification settings - Fork 3
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
Improvement to how backspace works #12
Comments
I think this differs a lot between use cases, but perhaps have a simple configuration page to select the expected backspace/delete behaviour? This could also include an option to set the keyboard shortcut, since Mac users don't have an insert key whatsoever (not even virtual). I had to change the shortcut in the package files for it to work at all. |
@ttlnow I definitely see the value in having this, but at the same time I think we should be careful about adding non-standard behaviour by default. Are there any major editors with this functionality? I've Tested in Notepad++, VS 2015 and Word, and they all delete the character. Since this is (probably) non-standard behaviour, we would need to add a configuration variable to enable it as @Endemoniada suggests. |
To me it makes sense that pressing backspace should replace the character deleted with a space character (being the best stand in for a blank character). In my opinion it wouldn't really hurt to replace the standard behavior as you can still easily remove the space characters with the delete key while in overtype mode but you cant add them without overwriting text you intended to keep. I feel other implementations get the functionality wrong. |
I worked on this. So that a backspace replaces the char left from the current caret-position with a space. greets Andreas |
I agree with other comments that having overtype backspace replace with a space is the better behavior. Though few editors do this, it is always the more useful behavior. Usually, when I am overtyping it's to replace code that has a columnar alignment which I want to retain, and if I backspace, it's to correct a typo; therefore I do not want to shift the text left. A major editor that does this is TextPad. And a major terminal that does this is IBM 5250. |
welcome to COBOL & friends :-) And here again, having a selection and triggering backspace on the selection, to me overwriting the selection with space and moving the caret to the beginning, seems to be the behavior of the least surprise ? Do you make use of multiple cursors/selections regularly ? Cos' I don't and i'm not sure if I should care/support it ? greets andreas |
I use multi-cursors and multi-selection all the time and overtype works when typing. It should work when pasting as well. Backspace at the beginning of a line should, I think, just delete the last character of the previous line, so, yes, preserving the line structure. TextPad does this and I find it intuitive. Backspace in TextPad elsewhere in the line moves the caret (block cursor) left and overwrites with a space. Overwriting a selection with spaces in overtype mode is I think the most intuitive behavior on any action that would delete (remove) the selection in insert mode, so backspace, typing, etc. Except, perhaps DELETE and CTL-X, which should actually delete it? |
@lawrence-dol
agreed on this and backspace-behaviour a'la TextPad fits my picture. Slowly i get an idea what the overwrite-mode could be a about. As a guiding thought, i'd say 'Return & Line-feeds are preserved - to not manipulate the text-structure.' What should happen when the return-key is pressed ? Following that idea, the caret would then hop to the beginning of the next line (maybe indent-pos), without inserting a line-feed. Basically doing a carriage-return instead of a new-line.
Maybe backspace on a selection keeps it with repositoning the caret, and DELETE/Ctrl-x completely kills it. Otherwise the effects of BS and DEL would be nearly identical. Anyhow, i'm testing and plan to put as much as possible into the settings-section. So one can at least enable/disable such behaviors |
ENTER => Non-destructively moving to the first character of the next line would be my preference. I think all choices erring on the side of "stable surroundings" will be the right option, with configuration for behavior where's there are more than one reasonable expectation of outcome. I think, though, I still would consider that DELETE/CTRL-X (especially CTRL-X) should erase a selection; and DELETE should be the same as in insert-mode. But I would not lose sleep over it and if it were configurable, then everyone can be happy. Thank you for doing this. |
DELETE as implemented now, is a compromise : On first hit it will overwrite a char with SPACE. If char is a SPACE, then the standard-delete happens. Line-feeds-chars will not be touched at all. greets |
Delete is problematic- there's nothing that can be done about that, but Backspace could work better with overtype mode: it would be best if it shifted the cursor left and overwrote the character with a space but kept the line length as-is (i.e. no deletion of characters). This would work nicely when editing Markdown tables and keeping the "cells" the same size.
The text was updated successfully, but these errors were encountered: