Skip to content

Commit

Permalink
fix: view settings get messed up by NeoVintageous plugin
Browse files Browse the repository at this point in the history
#6

Signed-off-by: Jack Cherng <[email protected]>
  • Loading branch information
jfcherng committed Apr 13, 2024
1 parent c57ba6e commit 8e0ad72
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugin/TodoReview.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ def get_or_create_view(self) -> sublime.View:
if view.settings().get("todo_results", False):
return view
view = self.window.new_file()
self.set_todo_view_settings(view)
return view

@staticmethod
def set_todo_view_settings(view: sublime.View) -> None:
view.set_name("TodoReview")
view.assign_syntax(TODO_SYNTAX_FILE)
view.set_scratch(True)
Expand All @@ -261,9 +266,7 @@ def get_or_create_view(self) -> sublime.View:
"line_padding_top": 2,
"word_wrap": False,
"command_mode": True,
"is_widget": True,
})
return view


class TodoReviewRenderCommand(sublime_plugin.TextCommand):
Expand Down Expand Up @@ -425,3 +428,9 @@ def run(self, edit: sublime.Edit, **args: Any) -> None:
)
self.view.show(sublime.Region(region.a, region.a + 5))
return


class TodoReviewListener(sublime_plugin.EventListener):
def on_activated(self, view: sublime.View) -> None:
# fixes https://github.com/jfcherng-sublime/ST-TodoReview/issues/6
TodoReviewCommand.set_todo_view_settings(view)

0 comments on commit 8e0ad72

Please sign in to comment.