diff options
author | Bibiko <bibiko@eva.mpg.de> | 2011-01-21 11:07:53 +0000 |
---|---|---|
committer | Bibiko <bibiko@eva.mpg.de> | 2011-01-21 11:07:53 +0000 |
commit | b06fec39e31ded08c69588ea35b8a5d01bbcb684 (patch) | |
tree | 187e9f49c95c6ea0fd4f8546189e08c49128abc9 /Source/SPTextView.m | |
parent | 683e3390b06f1db3df1dff6f5b3df8f37a3b461f (diff) | |
download | sequelpro-b06fec39e31ded08c69588ea35b8a5d01bbcb684.tar.gz sequelpro-b06fec39e31ded08c69588ea35b8a5d01bbcb684.tar.bz2 sequelpro-b06fec39e31ded08c69588ea35b8a5d01bbcb684.zip |
• fixed completion issue via alias names
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r-- | Source/SPTextView.m | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m index b4090cb9..41b5d6e4 100644 --- a/Source/SPTextView.m +++ b/Source/SPTextView.m @@ -773,6 +773,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) object:nil]; // Check for table name aliases + NSString *alias = nil; if(dbBrowseMode && tableDocumentInstance && customQueryInstance) { NSString *theDb = (dbName == nil) ? [NSString stringWithString:currentDb] : [NSString stringWithString:dbName]; NSString *connectionID = [tableDocumentInstance connectionID]; @@ -788,7 +789,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) for(NSString* m in matches) { NSRange aliasRange = [m rangeOfRegex:re capture:1L]; if(aliasRange.length) { - NSString *alias = [[m substringWithRange:aliasRange] stringByReplacingOccurrencesOfString:@"``" withString:@"`"]; + alias = [[m substringWithRange:aliasRange] stringByReplacingOccurrencesOfString:@"``" withString:@"`"]; // If alias refers to db.table split and check it if([alias rangeOfString:@"."].length) { NSRange dbRange = [alias rangeOfRegex:@"^`?(.*?)`?\\." capture:1L]; @@ -838,6 +839,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) caretMovedLeft:caretMovedLeft autoComplete:autoCompleteMode oneColumn:isDictMode + alias:alias isQueryingDBStructure:[mySQLConnection isQueryingDatabaseStructure]]; completionParseRangeLocation = parseRange.location; @@ -1460,6 +1462,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) caretMovedLeft:NO autoComplete:NO oneColumn:NO + alias:nil isQueryingDBStructure:NO]; //Get the NSPoint of the first character of the current word @@ -1616,6 +1619,7 @@ NSInteger alphabeticSort(id string1, id string2, void *reverse) caretMovedLeft:NO autoComplete:NO oneColumn:YES + alias:nil isQueryingDBStructure:NO]; //Get the NSPoint of the first character of the current word |