Skip to content

Commit

Permalink
fix(asm): Enhance assembly comment's folding
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Dec 21, 2023
1 parent 27c0fd0 commit 731adc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ts-fold-parsers.el
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@
'((label . ts-fold-range-asm-label)
(line_comment
. (lambda (node offset)
(ts-fold-range-line-comment node offset ";;")))))
(let ((text (tsc-node-text node)))
(cond ((string-prefix-p ";;" text)
(ts-fold-range-line-comment node offset ";;"))
((string-prefix-p "#" text)
(ts-fold-range-line-comment node offset "#"))
(t
(ts-fold-range-c-like-comment node offset))))))))

(defun ts-fold-parsers-bash ()
"Rule set for Bash."
Expand Down
2 changes: 2 additions & 0 deletions ts-fold-summary.el
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,11 @@ type of content by checking the word boundary's existence."
(defcustom ts-fold-summary-parsers-alist
`((actionscript-mode . ts-fold-summary-javadoc)
(arduino-mode . ts-fold-summary-c)
(asm-mode . ts-fold-summary-elisp)
(fasm-mode . ts-fold-summary-elisp)
(masm-mode . ts-fold-summary-elisp)
(nasm-mode . ts-fold-summary-elisp)
(gas-mode . ts-fold-summary-elisp)
(bat-mode . ts-fold-summary-batch)
(beancount-mode . ts-fold-summary-elisp)
(c-mode . ts-fold-summary-c)
Expand Down
2 changes: 2 additions & 0 deletions ts-fold.el
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
`((actionscript-mode . ,(ts-fold-parsers-actionscript))
(agda-mode . ,(ts-fold-parsers-agda))
(arduino-mode . ,(ts-fold-parsers-arduino))
(asm-mode . ,(ts-fold-parsers-asm))
(fasm-mode . ,(ts-fold-parsers-asm))
(masm-mode . ,(ts-fold-parsers-asm))
(nasm-mode . ,(ts-fold-parsers-asm))
(gas-mode . ,(ts-fold-parsers-asm))
(beancount-mode . ,(ts-fold-parsers-beancount))
(c-mode . ,(ts-fold-parsers-c))
(c++-mode . ,(ts-fold-parsers-c++))
Expand Down

0 comments on commit 731adc1

Please sign in to comment.