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

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

[nongnu] elpa/swift-mode 04c8a62 442/496: Fix beginning-of-defun hanging


From: ELPA Syncer
Subject: [nongnu] elpa/swift-mode 04c8a62 442/496: Fix beginning-of-defun hanging at the beginning of buffer
Date: Sun, 29 Aug 2021 11:34:24 -0400 (EDT)

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

    Fix beginning-of-defun hanging at the beginning of buffer
    
    Fixes #157.
    
    We would like to thank @dabrahams for reporting this, and @danielmartin for
    suggesting the cause.
---
 swift-mode-beginning-of-defun.el | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/swift-mode-beginning-of-defun.el b/swift-mode-beginning-of-defun.el
index 26f276e..89263a2 100644
--- a/swift-mode-beginning-of-defun.el
+++ b/swift-mode-beginning-of-defun.el
@@ -92,8 +92,11 @@ and the region is not active."
             (setq result (swift-mode:beginning-of-defun-backward))
             (when (< (point) last-position)
               (setq arg (1- arg)))
-            (when (< 0 arg)
-              (swift-mode:backward-token-or-list))))
+            (when (and (< 0 arg)
+                       (eq 'outside-of-buffer
+                           (swift-mode:token:type
+                            (swift-mode:backward-token-or-list))))
+              (setq result nil))))
       ;; Moving forward
       (setq result (swift-mode:beginning-of-defun-forward))
       (when (and result (< pos (point)))



reply via email to

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