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

Breaking insertion redoes up by words, combining deletions by words #162

Open
aaxu opened this issue Apr 11, 2018 · 0 comments
Open

Breaking insertion redoes up by words, combining deletions by words #162

aaxu opened this issue Apr 11, 2018 · 0 comments

Comments

@aaxu
Copy link
Contributor

aaxu commented Apr 11, 2018

Right now, if we have an an insertion as our last change, any further inserts will be concatenated to the same change. This has a couple of effects that I noticed have been slightly inconvenient so far.

  • If you only add inserts, the program will not see the file as have "changed" since the number of changes is still the same. Thus, if you quit the program, it will not ask if you want to save.
  • If you write a long line with only insertions, a single redo will undo the entire line.

I think if we break a long insert into multiple inserts split by white space, it would mitigate the second point and many cases in the first point. I think to completely solve the first point, we can maybe keep track of the last change and if it is an insertion change, we store it. Then when we are checking if the file is dirty, we can also add a check to see if the last insertion change is still the same.

Also, I was thinking of combining deletions in the same way that insertions are (or will be) implemented. Currently, each deletion is its own change so undoing a delete of 50 characters will require 50 undoes.

What do you think about these?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant