diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-01-29 10:35:39 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-01-29 10:35:39 +0000 |
commit | a0f3e12600411888242efd76959a124de74ee630 (patch) | |
tree | fd59656636d51cb824606ea56510593f72fbb39d /Source/CustomQuery.m | |
parent | 5e6610549483e09d47ef8c0432673393f5abc349 (diff) | |
download | sequelpro-a0f3e12600411888242efd76959a124de74ee630.tar.gz sequelpro-a0f3e12600411888242efd76959a124de74ee630.tar.bz2 sequelpro-a0f3e12600411888242efd76959a124de74ee630.zip |
• fixed some issues and improved the text macro behaviour
Diffstat (limited to 'Source/CustomQuery.m')
-rw-r--r-- | Source/CustomQuery.m | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/CustomQuery.m b/Source/CustomQuery.m index 45f177a3..2ce831f4 100644 --- a/Source/CustomQuery.m +++ b/Source/CustomQuery.m @@ -2016,6 +2016,14 @@ #pragma mark - #pragma mark TextView notifications +- (NSRange)textView:(NSTextView *)aTextView willChangeSelectionFromCharacterRange:(NSRange)oldSelectedCharRange toCharacterRange:(NSRange)newSelectedCharRange +{ + // Check if snippet session is still valid + if(!newSelectedCharRange.length && [textView isSnippetMode]) [textView checkForCaretInsideSnippet]; + + return newSelectedCharRange; +} + /* * A notification posted when the selection changes within the text view; * used to control the run-currentrun-selection button state and action. @@ -2026,7 +2034,6 @@ // Ensure that the notification is from the custom query text view if ( [aNotification object] != textView ) return; - [textView checkForCaretInsideSnippet]; // Remove all background color attributes used by highlighting the current query if([prefs boolForKey:SPCustomQueryHighlightCurrentQuery]) { // Remove only the background attribute for the current range if still valid |