-
Notifications
You must be signed in to change notification settings - Fork 273
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
normal-state interacts poorly with eval-last-sexp #17
Comments
Original comment by Frank Fischer (Bitbucket: lyro, GitHub: lyro): You may try the following code which advices some function when evil
|
Original comment by Anonymous: Thinks. I had to change them slightly so that they continued to work in insert-mode (I'm not sure if that was the intent, but I like it like that). But I have discovered one edge case (which also affects my solution): save-excursion means you can't move the cursor when doing eval-last-sexp in normal-mode. My current fix is to advise the "find the last sexp" functions instead:
(I'm not sure why both of these functions exist.) I haven't noticed any problems with this. It's possible that if someone uses these functions noninteractively, things would break; in that case, I can't think of a better solution than "reimplement [pp-]eval-last-sexp". But in core, they don't seem to be used anywhere bad: just a helper function of eval-last-sexp, and pp-eval-last-sexp and pp-macroexpand-last-sexp, respectively. |
2 similar comments
Create them with docstrings and allow them to optionally set the default states instead of keymaps (fixes emacs-evil#17).
Originally reported by: Anonymous
When a sexp closes at the end of a line, you can't use eval-last-sexp in normal-state to evaluate it because you can't get to the end of the line.
My solution is this command:
but I haven't used it much yet, and I don't know if there are edge cases. I have it on :eval and ;v.
The text was updated successfully, but these errors were encountered: