Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] ability to disable comment folding #44

Closed
pedro-nonfree opened this issue Jan 1, 2023 · 2 comments
Closed

[feature request] ability to disable comment folding #44

pedro-nonfree opened this issue Jan 1, 2023 · 2 comments

Comments

@pedro-nonfree
Copy link
Contributor

pedro-nonfree commented Jan 1, 2023

I really like the function folding it does this package; but I would like to avoid multiline comment folding?

main() {
  # example 1
  echo 'hi'
  # example 2
  echo 'hi'
  # example 3
  # example 4
  # example 5
  echo 'hi'
  # example 3
  # example 4
  # example 5
  echo 'hi'
  echo 'hi'
  echo 'hi'
  # example 3
  # example 5
  echo 'hi'
}

main "${@}"

given the following example I see a lot of mess in the indicator part (and also, makes it more complex to do the folding that you really want, in my case: function folding):

image

and I would like something more basic, like having comments that don't make additional foldings:

image

@jcs090218
Copy link
Member

You can now disable it with ts-fold-line-comment-mode, default is disabled!

Happy New Year! 🥳

@pedro-nonfree
Copy link
Contributor Author

oh waw, what a sweet surprise @jcs090218 !! thank you!

To upgrade I did

cd ~/.emacs.d/straight/repos/ts-fold
git pull

and then, I evaluated the emacs lisp expression to rebuild it:

(use-package ts-fold
  :straight (ts-fold :type git :host github :repo "emacs-tree-sitter/ts-fold"))

and then I restarted emacs, and looks like now by default it does not suggest comment folding, a decision that I support

so this is a screen capture just configuring it this way

;; src https://github.com/emacs-tree-sitter/ts-fold
(use-package ts-fold
  :straight (ts-fold :type git :host github :repo "emacs-tree-sitter/ts-fold"))
;; Else, a hook can be added to tree-sitter directly.
(add-hook 'tree-sitter-after-on-hook #'ts-fold-indicators-mode)
(global-set-key (kbd "C-c f") 'ts-fold-toggle)

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants