[PATCH] Continue with last-insertion tracker if buffer region is valid
Hey, all. Sorry to post this to the mailing list without something on the bug tracker, but bitbucket apparently has stopped taking OpenID and I don't think this report merits creating a whole new account and password. Commit db7e641 resolved Bug #272, "Evil works incorrectly with yasnippet near the end of buffer". The issue was that `evil-stop-track-last-insertion' would get confused if the last insertion appeared to extend past the buffer bounds, and the solution was to put in a guard. However, I think the guard is doing `<' and `>=' comparisons backwards. As in, shouldn't it be like the attached patch? Thanks, Trevor Murphy (1): Continue with last-insertion tracker if buffer region is valid evil-common.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.8.3
Commit db7e641 fixed issue #272, but unfortunately disabled the last-insertion tracker more often than intended by checking if `point-min' is `>=' the `(car evil-current-insertion)'. (Ditto, mutatis mutandis, the check on `point-max'). I think this is meant to go the other way. --- evil-common.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evil-common.el b/evil-common.el index a4e0209..0f44105 100644 --- a/evil-common.el +++ b/evil-common.el @@ -1899,8 +1899,8 @@ The tracked insertion is set to `evil-last-insertion'." ;; insertion information may be invalid. There is no way ;; to detect this situation, but at least we should ;; ensure that no error occurs (see bug #272). - (>= (point-min) (car evil-current-insertion)) - (< (point-max) (cdr evil-current-insertion)) + (>= (car evil-current-insertion) (point-min)) + (< (cdr evil-current-insertion) (point-max)) (buffer-substring-no-properties (car evil-current-insertion) (cdr evil-current-insertion)))) (remove-hook 'after-change-functions #'evil-track-last-insertion t)) -- 1.8.3
Trevor Murphy <[email protected]> writes:
Hey, all.
Sorry to post this to the mailing list without something on the bug tracker, but bitbucket apparently has stopped taking OpenID and I don't think this report merits creating a whole new account and password.
You can use the issue tracker anonymously, no need to create an account. But sending *small* issues to the mailing list is also fine, especially if a patch is provided ;)
Commit db7e641 resolved Bug #272, "Evil works incorrectly with yasnippet near the end of buffer". The issue was that `evil-stop-track-last-insertion' would get confused if the last insertion appeared to extend past the buffer bounds, and the solution was to put in a guard.
However, I think the guard is doing `<' and `>=' comparisons backwards. As in, shouldn't it be like the attached patch?
Ah, you're right, thanks a lot. It should even be (<= ... (point-max)). If added the patch. Best regards, Frank
participants (2)
-
Frank Fischer -
Trevor Murphy