aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPNarrowDownCompletion.m
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-07 22:42:15 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-07 22:42:15 +0000
commitbac0cd2fd1623d2b8cd91a26dce17c01b7f9f06f (patch)
treede25bab8e47a77c1c2aff64cf61fb7606c656360 /Source/SPNarrowDownCompletion.m
parent3df9eae4ed4aa8d21293e624c0beca069e77bdea (diff)
downloadsequelpro-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 ()
Diffstat (limited to 'Source/SPNarrowDownCompletion.m')
-rw-r--r--Source/SPNarrowDownCompletion.m9
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