From 3b18153ea7a600dcee96844fb76d76ec3f04475c Mon Sep 17 00:00:00 2001 From: Leo Okawa Ericson Date: Wed, 26 May 2021 15:56:49 +0200 Subject: [PATCH] Advice lispyville-end-of-defun to go past defuns `lispyville-end-of-defun' doesn't go to the next defun when point is already at the end of a defun, whereas `lispyville-beginning-of-defun' does. This commit fixes this inconsistency by matching `lispyville-end-of-defun''s behaviour with `lispyville-beginning-of-defun'. `line-end-position' isn't enough because it never returns `t' in normal mode (in normal mode the point can't reach the true end of a line). --- modules/editor/lispy/config.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/editor/lispy/config.el b/modules/editor/lispy/config.el index 3ca5ebb78..a4556cbe4 100644 --- a/modules/editor/lispy/config.el +++ b/modules/editor/lispy/config.el @@ -38,4 +38,14 @@ additional additional-insert)) :config - (lispyville-set-key-theme)) + (lispyville-set-key-theme) +;; REVIEW Delete this once https://github.com/noctuid/lispyville/pull/297 is merged + (defadvice! +lispy--fix-lispyville-end-of-defun-a (_) + "lispyville-end-of-defun doesn't go to the next defun when +point is already at the end of a defun, whereas +lispyville-beginning-of-defun does." + :before #'lispyville-end-of-defun + (when (<= (- (line-end-position) + (point)) + 1) + (forward-line))))