aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPTextView.m
diff options
context:
space:
mode:
authorsqlprodev <sqlprodev@northofthree.com>2013-02-14 19:25:27 +0000
committersqlprodev <sqlprodev@northofthree.com>2013-02-14 19:25:27 +0000
commit47069472a4b5dc6655338a77ec8b1eb9a5f5c3d9 (patch)
treec135c5b21ece6bb5bd8f63d56f7e95fa9852abb4 /Source/SPTextView.m
parentc37936d71c9c8ad9b721e33899bb118032466896 (diff)
downloadsequelpro-47069472a4b5dc6655338a77ec8b1eb9a5f5c3d9.tar.gz
sequelpro-47069472a4b5dc6655338a77ec8b1eb9a5f5c3d9.tar.bz2
sequelpro-47069472a4b5dc6655338a77ec8b1eb9a5f5c3d9.zip
Changes required to merge Sequel Pro r4011 into Coda
Diffstat (limited to 'Source/SPTextView.m')
-rw-r--r--Source/SPTextView.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/SPTextView.m b/Source/SPTextView.m
index 9a29460e..f659a3cd 100644
--- a/Source/SPTextView.m
+++ b/Source/SPTextView.m
@@ -86,7 +86,9 @@
@interface SPTextView (Private_API)
NSInteger _alphabeticSort(id string1, id string2, void *reverse);
+#ifndef SP_REFACTOR
- (void)_setTextSelectionColor:(NSColor *)newSelectionColor onBackgroundColor:(NSColor *)aBackgroundColor;
+#endif
- (void)_positionCompletionPopup:(SPNarrowDownCompletion *)aPopup relativeToTextAtLocation:(NSUInteger)aLocation;
@end
@@ -318,7 +320,11 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
{
NSMutableArray *possibleCompletions = [[NSMutableArray alloc] initWithCapacity:32];
+#ifndef SP_REFACTOR
if(currentWord == nil) currentWord = [NSString stringWithString:@""];
+#else
+ if(currentWord == nil) currentWord = @"";
+#endif
// If caret is not inside backticks add keywords and all words coming from the view.
if(!dbBrowseMode)
{
@@ -2911,7 +2917,11 @@ static inline NSPoint SPPointOnLine(NSPoint a, NSPoint b, CGFloat t) { return NS
#endif
if(tabStopWidth < 1) tabStopWidth = 1;
+#ifndef SP_REFACTOR
float tabWidth = NSSizeToCGSize([[NSString stringWithString:@" "] sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width;
+#else
+ float tabWidth = NSSizeToCGSize([@" " sizeWithAttributes:[NSDictionary dictionaryWithObject:tvFont forKey:NSFontAttributeName]]).width;
+#endif
tabWidth = (float)tabStopWidth * tabWidth;
NSInteger numberOfTabs = 256/tabStopWidth;
@@ -3715,6 +3725,7 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
return [string1 localizedCaseInsensitiveCompare:string2];
}
+#ifndef SP_REFACTOR
/**
* Take a supplied text selection colour, and if it contains an alpha component,
* pre-multiply it by the background colour before setting it to avoid drawing problems.
@@ -3738,6 +3749,7 @@ NSInteger _alphabeticSort(id string1, id string2, void *reverse)
// Set the selection colour
[self setSelectedTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:newSelectionColor, NSBackgroundColorAttributeName, nil]];
}
+#endif
/**
* Take a supplied autocompletion popup, and position it to the correct position