predragnikolic / InlineFold

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

Cannot fold anymore #10

Closed kapitanluffy closed 10 months ago

kapitanluffy commented 10 months ago

inline-fold-broken

So doing the fold command (Ctrl+Shift+[) won't work anymore. It also breaks on non-xml files (JS, TS).

predragnikolic commented 10 months ago

I created a fix for the fold issue, InlineFold will no longer try to unfold regions if the fold command was invoked.

    def on_text_command(self, command: str, _args: dict) -> None:
        if (command == 'fold'):
            self.skip_folding = True

When you press Ctrl+Shift+[ to fold, you should no longer experience the issue.


I noticed a ST bug. If you open the command palette and select the Fold command, you will still hit experience this issue because the on_text_command hook is not called (but I expect that ST calls this hook).

I do not plan to fix that case when it is triggered from the command palette.

predragnikolic commented 10 months ago

It also breaks on non-xml files (JS, TS).

Can you be more specific and provide the current and expected behavior?

And thanks for the bug report.

predragnikolic commented 10 months ago

I've created a new release that includes the "Fold" fix.

kapitanluffy commented 10 months ago

It also breaks on non-xml files (JS, TS).

Can you be more specific and provide the current and expected behavior?

And thanks for the bug report.

So normally attributes can only be seen in xml syntaxes (HTML, JSX, TSX, XML) but when I fold in Typescript, the bug happens (though not always)

So I was thinking maybe just enable it on xml syntaxes.

inline-fold-broken2

predragnikolic commented 10 months ago

Package Control still didn't pick up the new 0.0.5 release. (0.0.4 is still on PC)

Can you verify if this still happens once you upgrade to 0.0.5?

kapitanluffy commented 10 months ago

Package Control still didn't pick up the new 0.0.5 release. (0.0.4 is still on PC)

Can you verify if this still happens once you upgrade to 0.0.5?

Sure 👍

kapitanluffy commented 10 months ago

Fixed!