[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold 959191660b 115/417: Simplify
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold 959191660b 115/417: Simplify |
Date: |
Mon, 1 Jul 2024 10:02:17 -0400 (EDT) |
branch: elpa/treesit-fold
commit 959191660b18d1f75316f3e386a5bf36d9de3c3f
Author: Jen-Chieh <jcs090218@gmail.com>
Commit: Jen-Chieh <jcs090218@gmail.com>
Simplify
---
tree-sitter-fold.el | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
diff --git a/tree-sitter-fold.el b/tree-sitter-fold.el
index 446427aa6b..0854903706 100644
--- a/tree-sitter-fold.el
+++ b/tree-sitter-fold.el
@@ -422,14 +422,12 @@ more information."
For arguments NODE and OFFSET, see function `tree-sitter-fold-range-seq' for
more information."
- (let* ((children (tsc-count-children node))
- (result nil)
- (last_bracket (tsc-get-nth-child node (- children 1)))
- (first_bracket (tsc-get-nth-child node 2)))
- (setq result (cons
- (tsc-node-start-position first_bracket)
- (+ 1 (tsc-node-start-position last_bracket))))
- (tree-sitter-fold-util--cons-add result offset)))
+ (when-let* ((children (tsc-count-children node))
+ (last_bracket (tsc-get-nth-child node (- children 1)))
+ (first_bracket (tsc-get-nth-child node 2))
+ (beg (tsc-node-start-position first_bracket))
+ (end (1+ (tsc-node-start-position last_bracket))))
+ (tree-sitter-fold-util--cons-add (cons beg end) offset)))
(provide 'tree-sitter-fold)
;;; tree-sitter-fold.el ends here
- [nongnu] elpa/treesit-fold a5d413e45c 074/417: Complete Java, (continued)
- [nongnu] elpa/treesit-fold a5d413e45c 074/417: Complete Java, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold de128eaf10 076/417: Add CSS, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 23bd9c2c05 077/417: Add CSS, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold fef90261f5 082/417: Apply offset, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 76e0dd263e 088/417: Hide indicators when single line, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 8fc88e29f5 089/417: Login update for Csharp comment, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 809bc9a0db 090/417: Remove go decalaration, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 422cff043e 100/417: Fix comment line, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 2d2179292f 105/417: Fix doc string, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 5062bf22a8 112/417: Mark temp, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 959191660b 115/417: Simplify,
ELPA Syncer <=
- [nongnu] elpa/treesit-fold 7065c6b28f 122/417: Apply macro, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f49df1ea3d 124/417: Update doc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6f15c1735a 125/417: Support javascript comment, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold eeb9c03bcc 127/417: Fix conitouse line, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold c33e5e7e0c 128/417: Temporily disable csharp, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6b6f30eb4a 142/417: Add emoji, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 6aabbc6256 147/417: Update doc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold e6ac78f0e2 154/417: SCALE AND CENTER, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold a806886568 161/417: Update support language list, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 2409596f33 004/417: readme: fix typo, ELPA Syncer, 2024/07/01