aboutsummaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBibiko <bibiko@eva.mpg.de>2010-03-11 20:41:01 +0000
committerBibiko <bibiko@eva.mpg.de>2010-03-11 20:41:01 +0000
commit98af234687c698826817a6c219ce8f731fdfa1e7 (patch)
tree6feb775ef017193c181f6e6fe613c39ef435d215 /Source
parent304ab84d1432207f4882386193405aa8fcb760d3 (diff)
downloadsequelpro-98af234687c698826817a6c219ce8f731fdfa1e7.tar.gz
sequelpro-98af234687c698826817a6c219ce8f731fdfa1e7.tar.bz2
sequelpro-98af234687c698826817a6c219ce8f731fdfa1e7.zip
• append () after completion of a stored procedure
Diffstat (limited to 'Source')
-rw-r--r--Source/SPNarrowDownCompletion.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPNarrowDownCompletion.m b/Source/SPNarrowDownCompletion.m
index 42660be1..6667f848 100644
--- a/Source/SPNarrowDownCompletion.m
+++ b/Source/SPNarrowDownCompletion.m
@@ -769,8 +769,8 @@
// If completion string contains backticks move caret out of the backticks
if(backtickMode && !triggerMode)
[theView performSelector:@selector(moveRight:)];
- // If it's a function insert () and if given arguments as snippets
- else if([prefs boolForKey:SPCustomQueryFunctionCompletionInsertsArguments] && [[[filtered objectAtIndex:[theTableView selectedRow]] objectForKey:@"image"] hasPrefix:@"func"] && ![aString hasSuffix:@")"]) {
+ // If it's a function or procedure append () and if a argument list can be retieved insert them as snippets
+ else if([prefs boolForKey:SPCustomQueryFunctionCompletionInsertsArguments] && ([[[filtered objectAtIndex:[theTableView selectedRow]] objectForKey:@"image"] hasPrefix:@"func"] || [[[filtered objectAtIndex:[theTableView selectedRow]] objectForKey:@"image"] hasPrefix:@"proc"]) && ![aString hasSuffix:@")"]) {
NSString *functionArgumentSnippet = [NSString stringWithFormat:@"(%@)", [[SPQueryController sharedQueryController] argumentSnippetForFunction:aString]];
[theView insertAsSnippet:functionArgumentSnippet atRange:[theView selectedRange]];
if([functionArgumentSnippet length] == 2)