tsx-mode.el icon indicating copy to clipboard operation
tsx-mode.el copied to clipboard

Origami regions for things other than CSS-in-JS

Open eutro opened this issue 2 years ago • 2 comments

Origami is great since it lets you fold large sections of code such as function bodies or classes. The default behaviour of tsx-mode is to set origami regions exclusively to CSS-in-JS regions, so these can be folded. This is great, but thoroughly counterproductive for anyone that wishes to use origami for folding actual blocks of code. With this issue I'd like to request that origami regions are created not just for CSS-in-JS, but can also be created, configurably, for any tree-sitter node. Curly brace blocks, for example, should be included as default behaviour, as it is for other C-like languages.

eutro avatar Jul 19 '22 14:07 eutro

ah, yes, that makes sense. I don't use code-folding outside of CSS-in-JS and so didn't think of this use case, but you're right. this shouldn't be too hard to fix.

orzechowskid avatar Jul 20 '22 03:07 orzechowskid

that wasn't too bad. have a look at the 28/origami branch and see if that addresses your concerns.

orzechowskid avatar Jul 21 '22 20:07 orzechowskid

fixed by #29 .

orzechowskid avatar Aug 14 '22 02:08 orzechowskid