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

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

[nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of


From: ELPA Syncer
Subject: [nongnu] elpa/typescript-mode 1d32c6b3a8 066/222: Improve readability of the code.
Date: Sun, 6 Feb 2022 16:59:17 -0500 (EST)

branch: elpa/typescript-mode
commit 1d32c6b3a83161ec2e97e544b4a538065e54b26f
Author: Louis-Dominique Dubeau <ldd@lddubeau.com>
Commit: Louis-Dominique Dubeau <ldd@lddubeau.com>

    Improve readability of the code.
    
    Flatten the code to a single `cond` instead of nested `cond` and
    `if`. It makes the code easier to follow.
---
 typescript-mode.el | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/typescript-mode.el b/typescript-mode.el
index 448a31e519..e6110bbad6 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -1809,14 +1809,15 @@ moved on success."
             (loop named search-loop
                   do (progn
                        (cond
+                        ;; Looking at the arrow of an arrow function:
+                        ;; move back over the arrow.
+                        ((looking-back "=>" (- (point) 2))
+                         (backward-char 2))
+                        ;; Looking at the end of the parameters list
+                        ;; of a generic: move back over the list.
                         ((eq (char-before) ?>)
-                         (if (looking-back "=>" (- (point) 2))
-                             ;; Move back over the arrow of an arrow function.
-                             (backward-char 2)
-                           ;; Otherwise, we are looking at the end of the 
parameters
-                           ;; list of a generic. We need to move back over the 
list.
-                           (backward-char)
-                           (typescript--backward-over-generic-parameter-list)))
+                         (backward-char)
+                         (typescript--backward-over-generic-parameter-list))
                         ;; Looking at a union: skip over the character.
                         ((eq (char-before) ?|)
                          (backward-char))



reply via email to

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