From b9cf32be521da665c598921e3666fadc87725b1f Mon Sep 17 00:00:00 2001 From: Alex Leach Date: Tue, 30 Jul 2013 08:57:18 +0100 Subject: [PATCH] Add a couple bug fixes to SublimeBlockCursor.py. Fix NameError, as view_is_widget was defined as a method, but used like a function. So, moved it out of the class and added a None type check, to suppress some errors I saw in the console --- SublimeBlockCursor.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/SublimeBlockCursor.py b/SublimeBlockCursor.py index 8f52de6..b344d57 100644 --- a/SublimeBlockCursor.py +++ b/SublimeBlockCursor.py @@ -3,9 +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 = [] @@ -19,6 +16,8 @@ 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') @@ -40,3 +39,7 @@ def on_activated(self, view): def on_command_mode_change(self): self.on_selection_modified(self.current_view) + +def view_is_widget(view): + settings = view.settings() + return bool(settings.get('is_widget'))