emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/swift-mode 021fdb1 414/496: Tweak mark-defun


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 021fdb1 414/496: Tweak mark-defun
Date: Sun, 29 Aug 2021 11:34:18 -0400 (EDT)

branch: elpa/swift-mode
commit 021fdb11fbee4914aaa012454dfcfc24f110d6f4
Author: taku0 <mxxouy6x3m_github@tatapa.org>
Commit: taku0 <mxxouy6x3m_github@tatapa.org>

    Tweak mark-defun
---
 swift-mode-beginning-of-defun.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/swift-mode-beginning-of-defun.el b/swift-mode-beginning-of-defun.el
index a9c4690..0fd04b1 100644
--- a/swift-mode-beginning-of-defun.el
+++ b/swift-mode-beginning-of-defun.el
@@ -662,10 +662,11 @@ PREFERRED-DIRECTION is the preferred direction of 
extension when DIRECTION is
          (new-region (nth 0 new-region-and-direction))
          (new-direction (nth 1 new-region-and-direction)))
     (when new-region
-      (setq new-region
-            (cons
-             (min (car original-region) (car new-region))
-             (max (cdr original-region) (cdr new-region))))
+      (when (/= (car original-region) (cdr original-region))
+        (setq new-region
+              (cons
+               (min (car original-region) (car new-region))
+               (max (cdr original-region) (cdr new-region)))))
       ;; Marks the whole outer block if the mark got out of the outer block.
       (save-excursion
         (goto-char (cdr new-region))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]