diff options
author | Bibiko <bibiko@eva.mpg.de> | 2010-03-07 22:42:15 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2010-03-07 22:42:15 +0000 |
commit | bac0cd2fd1623d2b8cd91a26dce17c01b7f9f06f (patch) | |
tree | de25bab8e47a77c1c2aff64cf61fb7606c656360 | |
parent | 3df9eae4ed4aa8d21293e624c0beca069e77bdea (diff) | |
download | sequelpro-bac0cd2fd1623d2b8cd91a26dce17c01b7f9f06f.tar.gz sequelpro-bac0cd2fd1623d2b8cd91a26dce17c01b7f9f06f.tar.bz2 sequelpro-bac0cd2fd1623d2b8cd91a26dce17c01b7f9f06f.zip |
• function completion
- do not insert () after a function if inserted string ends with )
- no snippet insertion for () - only locate the caret inside ()
-rw-r--r-- | Source/SPNarrowDownCompletion.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m index 8e5bebec..3df3d7b6 100644 --- a/Source/SPNarrowDownCompletion.m +++ b/Source/SPNarrowDownCompletion.m @@ -671,11 +671,16 @@ { [theView setSelectedRange:theCharRange]; [theView insertText:aString]; + // If completion string contains backticks move caret out of the backticks if(backtickMode && !triggerMode) [theView performSelector:@selector(moveRight:)]; - else if([[[filtered objectAtIndex:[theTableView selectedRow]] objectForKey:@"image"] hasPrefix:@"func"]) - [theView insertAsSnippet:@"(${1:})" atRange:[theView selectedRange]]; + // If it's a function insert () snippet + else if([[[filtered objectAtIndex:[theTableView selectedRow]] objectForKey:@"image"] hasPrefix:@"func"] && ![aString hasSuffix:@")"]) { + [theView insertText:@"()"]; + [theView performSelector:@selector(moveLeft:)]; + // [theView insertAsSnippet:@"(${1:})" atRange:[theView selectedRange]]; + } } - (void)completeAndInsertSnippet |