[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/treesit-fold eeff646b21 260/417: Optimize performance of t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/treesit-fold eeff646b21 260/417: Optimize performance of ts-fold-close-all with indicators-mode on (#53) |
Date: |
Mon, 1 Jul 2024 10:02:32 -0400 (EDT) |
branch: elpa/treesit-fold
commit eeff646b21961a1470de2cb38560faa9c8d37378
Author: norris <810896824@qq.com>
Commit: GitHub <noreply@github.com>
Optimize performance of ts-fold-close-all with indicators-mode on (#53)
* Optimize performance of ts-fold-close-all with indicators-mode on
Since ts-fold-close-all and ts-fold-close are both advised,
ts-fold-indicators-refresh will be called every time ts-fold-close-all calls
ts-fold-close on target nodes. Then ts-fold-close-all is far from being
responsive with indicators-mode on.
So we just remove the advice before we call ts-fold-close in
ts-fold-close-all,
and get it back before we leave. Of course, ts-fold-indicators-refresh will
be
called as an advice of ts-fold-close-all which we didn't modify.
* Disable ts-fold-indicators-mode in ts-fold-close-all
Temporarily disable ts-fold-indicators-mode in ts-fold-close-all to avoid
ts-fold-indicators-refresh for each ts-fold-close call in
ts-fold-close-all. So it is unnecessary to modify the advice.
---------
Co-authored-by: Arto Young <arto.young@outlook.com>
---
ts-fold.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ts-fold.el b/ts-fold.el
index ed060af687..e6c20cb347 100644
--- a/ts-fold.el
+++ b/ts-fold.el
@@ -324,7 +324,8 @@ If the current node is not folded or not foldable, do
nothing."
"Fold all foldable syntax nodes in the buffer."
(interactive)
(ts-fold--ensure-ts
- (let* ((node (tsc-root-node tree-sitter-tree))
+ (let* ((ts-fold-indicators-mode)
+ (node (tsc-root-node tree-sitter-tree))
(patterns (seq-mapcat (lambda (fold-range) `((,(car fold-range))
@name))
(alist-get major-mode ts-fold-range-alist)
'vector))
- [nongnu] elpa/treesit-fold a035da60ad 202/417: apply, (continued)
- [nongnu] elpa/treesit-fold a035da60ad 202/417: apply, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold d58795618a 199/417: Update README.md, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold afa4f3b9a0 216/417: Merge pull request #11 from jcs-elpa/docs, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 5a94124104 221/417: fix(indicators): Render indicators once it's mode is enabled (#19), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 401aad7380 223/417: Readme update (#20), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 0e83f0e5ef 227/417: docs(CHANGELOG): update, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 9f24d29c07 233/417: Julia language parser. (#33), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold bbb1eae1a7 234/417: docs(CHANGELOG): fix PR number for #33, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold fe568ebead 246/417: chore: changelog, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold ad1d9b2412 258/417: feat(fold): Add support for Lua (#52), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold eeff646b21 260/417: Optimize performance of ts-fold-close-all with indicators-mode on (#53),
ELPA Syncer <=
- [nongnu] elpa/treesit-fold e8a4110921 261/417: docs: Fix typo, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 7a46b695a1 263/417: Quick fix for ts-fold not checking if tree-sitter is enabled (#55), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 5fd2a5afe2 264/417: fix: Avoid dynamic an already lexical var error, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold aa37d3bb5f 294/417: fix: Improve Elixir UX (#78), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 2014def24a 289/417: feat: Add Verilog support (#75), ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold abd12c8fda 146/417: Fix toc, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 790247d439 157/417: Swap demo, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 03872ff486 169/417: Update readme, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold f1297ee040 170/417: Add elpa badge, ELPA Syncer, 2024/07/01
- [nongnu] elpa/treesit-fold 7c2b421d04 163/417: Fill gap, ELPA Syncer, 2024/07/01