From 3b59093cd3d5be30a809bdc6bb9f3ba63c9ce275 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 9 Apr 2010 13:01:52 +0000 Subject: When displaying a table/view's create syntax in the extended table information view or create syntax sheet remember to append a semi-colon. Fixes issue #629. --- Source/SPExtendedTableInfo.m | 8 +++++--- Source/TableDocument.m | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/SPExtendedTableInfo.m b/Source/SPExtendedTableInfo.m index 9636ca4c..98994acf 100644 --- a/Source/SPExtendedTableInfo.m +++ b/Source/SPExtendedTableInfo.m @@ -237,7 +237,8 @@ [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCreateSyntaxTextView string] length]) replacementString:@""]; [tableCreateSyntaxTextView setString:@""]; - NSString *createViewSyntax = [[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier]; + NSString *createViewSyntax = [[[tableDataInstance tableCreateSyntax] createViewSyntaxPrettifier] stringByAppendingString:@";"]; + if (createViewSyntax) { [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:createViewSyntax]; [tableCreateSyntaxTextView insertText:createViewSyntax]; @@ -281,6 +282,7 @@ NSArray *collations = [databaseDataInstance getDatabaseCollationsForEncoding:[tableDataInstance tableEncoding]]; if (([engines count] > 0) && ([statusFields objectForKey:@"Engine"])) { + // Populate type popup button for (NSDictionary *engine in engines) { @@ -351,14 +353,14 @@ [tableCommentsTextView setString:[statusFields objectForKey:@"Comment"]]; [tableCommentsTextView didChangeText]; [tableCommentsTextView setEditable:enableInteraction]; - + // Set create syntax [tableCreateSyntaxTextView setEditable:YES]; [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, [[tableCommentsTextView string] length]) replacementString:@""]; [tableCreateSyntaxTextView setString:@""]; [tableCreateSyntaxTextView didChangeText]; [tableCreateSyntaxTextView shouldChangeTextInRange:NSMakeRange(0, 0) replacementString:[tableDataInstance tableCreateSyntax]]; - [tableCreateSyntaxTextView insertText:[tableDataInstance tableCreateSyntax]]; + [tableCreateSyntaxTextView insertText:[[tableDataInstance tableCreateSyntax] stringByAppendingString:@";"]]; [tableCreateSyntaxTextView didChangeText]; [tableCreateSyntaxTextView setEditable:NO]; diff --git a/Source/TableDocument.m b/Source/TableDocument.m index bd12b9bf..ab8a7ac5 100644 --- a/Source/TableDocument.m +++ b/Source/TableDocument.m @@ -1684,10 +1684,10 @@ } [createTableSyntaxTextField setStringValue:[NSString stringWithFormat:@"Create syntax for %@ '%@'", typeString, [self table]]]; - + [createTableSyntaxTextView setEditable:YES]; [createTableSyntaxTextView setString:@""]; - [createTableSyntaxTextView insertText:([tablesListInstance tableType] == SPTableTypeView) ? [tableSyntax createViewSyntaxPrettifier] : tableSyntax]; + [createTableSyntaxTextView insertText:([tablesListInstance tableType] == SPTableTypeView) ? [[tableSyntax createViewSyntaxPrettifier] stringByAppendingString:@";"] : [tableSyntax stringByAppendingString:@";"]]; [createTableSyntaxTextView setEditable:NO]; [createTableSyntaxWindow makeFirstResponder:createTableSyntaxTextField]; -- cgit v1.2.3