2039324476
OK landry@
61 lines
2.2 KiB
Plaintext
61 lines
2.2 KiB
Plaintext
$OpenBSD: patch-GemasEditorView_m,v 1.1 2011/05/20 07:33:45 sebastia Exp $
|
|
|
|
fix build with gcc-2.95
|
|
|
|
--- GemasEditorView.m.orig Sun May 1 05:54:22 2011
|
|
+++ GemasEditorView.m Thu May 19 09:18:19 2011
|
|
@@ -126,10 +126,12 @@
|
|
- (void) insertNewline: (id)sender
|
|
{
|
|
NSString *spaceToInsert, *previousLine = nil;
|
|
-
|
|
+ NSString *lastLine;
|
|
+ NSRange textRange;
|
|
+ NSArray *lines;
|
|
[super insertNewline: sender];
|
|
- NSRange textRange = [self selectedRange];
|
|
- NSArray *lines = [[[self string] substringFromRange: NSMakeRange(0, textRange.location)]
|
|
+ textRange = [self selectedRange];
|
|
+ lines = [[[self string] substringFromRange: NSMakeRange(0, textRange.location)]
|
|
componentsSeparatedByString: @"\n"];
|
|
|
|
if ([lines count] >= 3)
|
|
@@ -139,7 +141,7 @@
|
|
@" " withString: @""];
|
|
}
|
|
|
|
- NSString *lastLine = [lines objectAtIndex: [lines count] - 2];
|
|
+ lastLine = [lines objectAtIndex: [lines count] - 2];
|
|
|
|
if ([[NSCharacterSet whitespaceAndNewlineCharacterSet] isSupersetOfSet: [NSCharacterSet characterSetWithCharactersInString: lastLine]])
|
|
{
|
|
@@ -147,12 +149,13 @@
|
|
}
|
|
else
|
|
{
|
|
+ unichar lastChar;
|
|
NSInteger tab = [[NSUserDefaults standardUserDefaults]
|
|
integerForKey: @"Indentation"];
|
|
NSString *checkLine = [lastLine stringByReplacingOccurrencesOfString: @" " withString: @""];
|
|
spaceToInsert = [lastLine stringByDeletingSuffix: [lastLine stringByTrimmingLeadSpaces]];
|
|
|
|
- unichar lastChar = [[lastLine stringByTrimmingTailSpaces] characterAtIndex: [[lastLine stringByTrimmingTailSpaces] length] - 1];
|
|
+ lastChar = [[lastLine stringByTrimmingTailSpaces] characterAtIndex: [[lastLine stringByTrimmingTailSpaces] length] - 1];
|
|
|
|
if ((([indentCharacters characterIsMember: lastChar]) &&
|
|
(![previousLine hasPrefix: @"switch("])) ||
|
|
@@ -273,9 +276,11 @@
|
|
click obove one*/
|
|
- (void) mouseDown: (NSEvent *)event
|
|
{
|
|
+ NSRange textRange;
|
|
+ NSString *selection;
|
|
[super mouseDown: event];
|
|
- NSRange textRange = [self selectedRange];
|
|
- NSString *selection = [[self string] substringFromRange: textRange];
|
|
+ textRange = [self selectedRange];
|
|
+ selection = [[self string] substringFromRange: textRange];
|
|
|
|
if ([selection length] == 1)
|
|
{
|