From 70dedd4f0f5a9fe3d0c567d80fbd8b4b052e36eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9F=D1=80=D0=B5=D0=B4=D1=80=D0=B0=D0=B3=20=D0=9D=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=BB=D0=B8=D1=9B?= Date: Tue, 12 Dec 2023 18:17:26 +0100 Subject: [PATCH] fix https://github.com/predragnikolic/InlineFold/issues/10 --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index c4f8cb4..a5ebfc2 100644 --- a/main.py +++ b/main.py @@ -19,11 +19,20 @@ class InlineFoldListener(sublime_plugin.ViewEventListener): def __init__(self, view: sublime.View) -> None: super().__init__(view) self.last_cursors = [] + # skip_folding was introduced to fix https://github.com/predragnikolic/InlineFold/issues/10 + self.skip_folding = False def on_load(self) -> None: self.view.run_command('inline_fold_all') + def on_text_command(self, command: str, _args: dict) -> None: + if (command == 'fold'): + self.skip_folding = True + def on_selection_modified(self) -> None: + if self.skip_folding: + self.skip_folding = False + return self.schedule() def schedule(self) -> None: