Add support for overwrite-mode to replace content with actual input#137
Open
Add support for overwrite-mode to replace content with actual input#137
Conversation
The bug #84 is really hard to solve. There is a workaround needed. When overwrite-mode is active it tries to untabify tabs by replacing the it with spaces. So when a tab is 4 spaces and overwrite-mode deletes one tab, then it inserts 4 spaces and moves one space forward. The problem: we aren't deleting any tabs so this logic should not be triggered but it's triggered by the insertion of old-text while old-text contains nothing whitespace related. The question persists why is untabify-logic applied? Right, it's a bug... Add workaround by setting deactivating overwrite-mode when calling delete-forward/backward Consolidate overwrite-mode handling by extracting a predicate Handle only self-insert-commands specially in overwrite-mode End-of-line has to handled specially because we consider spaces valid input for newlines. overwrite-mode should not replace newlines with spaces not should it insert additional spaces. Test: + Add newline and tab insertion to default case + Generalize test using random
43c8d28 to
27c9c57
Compare
Collaborator
Author
|
Well now, much complexity added, needs more testing... |
Collaborator
Author
|
It's hard to test something with |
Collaborator
Author
|
Backspace causes error, the session does not break. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #132
Fixes #101