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

Does not revert when undo #8

Closed
XO39 opened this issue May 27, 2021 · 11 comments
Closed

Does not revert when undo #8

XO39 opened this issue May 27, 2021 · 11 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@XO39
Copy link

XO39 commented May 27, 2021

When starting editing a line (or some lines), that line is highlighted as intended, but if I undo the changes, highlighting still there, even if I undo to the starting point and there is nothing to save in the file.

It will be nice if the highlighting disappear for undone changes.

@jcs090218
Copy link
Member

Yes, this is a known missing feature. I was trying to implement this but I have not figure out the best solution yet! Thanks for reporting this feature request!

@jcs090218 jcs090218 added enhancement New feature or request help wanted Extra attention is needed labels May 28, 2021
@jcs090218
Copy link
Member

Okay, I implemented this feature with few latest commits. Can you upgrade and see if it works? Thanks!

@XO39
Copy link
Author

XO39 commented May 31, 2021

I upgraded to the last version (list-packages U x y), added a space to the end of line then undo, it works for this, but when I make changes then save, there are couple of issues:

  1. Color does not change when save
  2. It throws Wrong number of arguments: (0 . 0), 1 when save

I had to disable this package temporarily till they are fixed

@jcs090218
Copy link
Member

Can you turn on debug-on-error and paste the backtrace of that error? I cannot reproduce this, maybe try uninstall the package cleanly and reinstall it?

I did encounter similar issue in early stages of this feature's implementation. Yet now, I think this issue should already be gone. 😕

@XO39
Copy link
Author

XO39 commented May 31, 2021

(void-variable ind-managed-absolute-indicators)
line-reminder--ind-delete-dups()
line-reminder--before-change-functions(2267 2267)
self-insert-command(1 32)
funcall-interactively(self-insert-command 1 32)
call-interactively(self-insert-command nil nil)
command-execute(self-insert-command)

(wrong-number-of-arguments (0 . 0) 1)
line-reminder--save-buffer(1)
apply(line-reminder--save-buffer 1)
save-buffer(1)
funcall-interactively(save-buffer 1)
call-interactively(save-buffer nil nil)
command-execute(save-buffer)

Got these two kinds of errors

@jcs090218
Copy link
Member

(wrong-number-of-arguments (0 . 0) 1)
line-reminder--save-buffer(1)

Okay, I push a fix here. Didn't know save-buffer takes arguments.

(void-variable ind-managed-absolute-indicators)

Not sure how you get this error. I have require indicators at the start of the package enablement. See

https://github.com/jcs-elpa/line-reminder/blob/1856034d0ed8ce41a29a1ea051184ee7c2f3e276/line-reminder.el#L500

Make sure you set line-reminder-show-option before enabling line-reminder-mode.

@XO39
Copy link
Author

XO39 commented May 31, 2021

OK, the errors are gone now.

As for the undo revert functionality, there is still an issue. The marks disappear only if I undo all the way back to the first change in the whole file. It they should be disappear as soon as undoing first change in a line (not in the while file).

@jcs090218
Copy link
Member

As for the undo revert functionality, there is still an issue. The marks disappear only if I undo all the way back to the first change in the whole file. It they should be disappear as soon as undoing first change in a line (not in the while file).

Hmm.. I think that's the design? Do you have a reference so I can play around (any editors)? I am using Visual Studio IDE to see the changes, and it only disappears when the file has undo to the root of the node.

@XO39
Copy link
Author

XO39 commented May 31, 2021

Oh, OK, I only use Emacs, and I know you are making it similar to the one used in Visual Studio IDE, but I think the original design is not quite perfect, it it will be much better to make marks disappear per line, I don't know how difficult the implementation is/will be/(cost in performance), but maybe there can be a root per line? For know it's useful but always seek for perfection

@jcs090218
Copy link
Member

but maybe there can be a root per line?

Do you mean a sequence of undo changes? I am using undo-tree, and this package currently supports it.

For know it's useful but always seek for perfection

Any suggestions are welcome! As long I understand your needs! 👍

@jcs090218
Copy link
Member

I am going to close this issue for now since this is implemented! :)

Feel free to open up another issue for enhancement or suggestions! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants