summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Ruffing <dev@real-or-random.org>2026-02-04 12:11:18 +0100
committerYoumu <condy0919@gmail.com>2026-03-06 01:07:50 +0800
commitf915c1934c7ac627eb1dfa5121ead73a6652e13a (patch)
treeea182f6ee847fb5e715bbb3c399805698f3b9cc8
parentc262b85e1b9e8cf52f5d08301c2269498836439c (diff)
magit: Fix :exclude-newline rewriting
Only rewrite the EXCLUDE-NEWLINE argument when evil-collection-magit-in-visual-pre-command is t. Previously the code always rewrote the argument to nil even when evil-collection-magit-in-visual-pre-command was not bound.
-rw-r--r--modes/magit/evil-collection-magit.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/modes/magit/evil-collection-magit.el b/modes/magit/evil-collection-magit.el
index 01dec87..f3dc30b 100644
--- a/modes/magit/evil-collection-magit.el
+++ b/modes/magit/evil-collection-magit.el
@@ -263,10 +263,10 @@ evil-collection-magit was loaded."
(defun evil-collection-magit--filter-args-visual-expand-region (arglist)
;; pretend that the command has the :exclude-newline property by rewriting the
;; EXCLUDE-NEWLINE arg to this function
- (cons (and (bound-and-true-p evil-collection-magit-in-visual-pre-command)
- (null (car arglist))
- (eq (evil-visual-type) 'line)
- (derived-mode-p 'magit-mode))
+ (cons (or (car arglist)
+ (and (bound-and-true-p evil-collection-magit-in-visual-pre-command)
+ (eq (evil-visual-type) 'line)
+ (derived-mode-p 'magit-mode)))
;; shouldn't be necessary, but this will prevent it from failing if an
;; arg is added.
(cdr arglist)))