diff --git a/SublimeBlockCursor.py b/SublimeBlockCursor.py index 8f52de6..069e6c2 100644 --- a/SublimeBlockCursor.py +++ b/SublimeBlockCursor.py @@ -3,10 +3,6 @@ class SublimeBlockCursor(sublime_plugin.EventListener): - def view_is_widget(view): - settings = view.settings() - return bool(settings.get('is_widget')) - def show_block_cursor(self, view): validRegions = [] for s in view.sel(): @@ -19,10 +15,14 @@ def show_block_cursor(self, view): view.erase_regions('SublimeBlockCursorListener') def on_selection_modified(self, view): + if view is None: + return + is_vintage_mode = "Vintage" not in view.settings().get('ignored_packages', []) command_mode = view.settings().get('command_mode') + view_is_widget = bool(view.settings().get('is_widget')) - if view_is_widget(view) or (is_vintage_mode and not command_mode): + if view_is_widget or (is_vintage_mode and not command_mode): view.erase_regions('SublimeBlockCursorListener') return