predragnikolic / InlineFold

A Sublime Text plugin that is useful to fold regions into a single line.
MIT License
7 stars 2 forks source link

Support a regular expression for `preceding_text` #6

Open FichteFoll opened 1 year ago

FichteFoll commented 1 year ago

This isn't a huge priority, but I wanted to list it here as food for thought.

I'd like to only hide the class attribute text if it doesn't stand on its own line already, because that indicates that I am having exactly one attribute per line. In order to do that, I could match for \S\s+class="$, but the current preceding_text setting does not support this kind of flexibility.

Example:


                <span class="text-danger">
                    some text be here. the class above should be folded
                </span>

                <span 
                    class="text-danger"
                >
                    more text. here, the class should not be folded
                </span>