This commit is contained in:
Jeena Paradies 2012-11-09 22:42:57 +01:00
parent fa2bda0394
commit f299176e7e
2 changed files with 14 additions and 4 deletions

View file

@ -323,6 +323,7 @@
NSString *js = [NSString stringWithFormat:@"tentia_instance.showStatus('%@', '%@');", postId, entity];
[conversationView stringByEvaluatingJavaScriptFromString:js];
[conversationViewWindow makeKeyAndOrderFront:self];
conversationViewWindow.title = @"Test";
}
/* CARBON */

View file

@ -141,11 +141,20 @@
BOOL retval = NO;
if (commandSelector == @selector(insertNewline:)) {
retval = YES; // causes Apple to NOT fire the default enter action
textField.stringValue = [NSString stringWithFormat:@"%@\n", textField.stringValue];
NSText *text = [[textField window] fieldEditor:YES forObject:nil];
NSRange range = [text selectedRange];
NSString *stringBefore = [textField.stringValue substringToIndex:range.location];
NSString *stringAfter = [textField.stringValue substringFromIndex:range.location + range.length];
textField.stringValue = [NSString stringWithFormat:@"%@\n%@", stringBefore, stringAfter];
[[[textField window] fieldEditor:YES forObject:nil] scrollRangeToVisible:NSMakeRange([[textField stringValue] length], 0)];
[[[textField window] fieldEditor:YES forObject:nil] setSelectedRange:NSMakeRange([[textField stringValue] length], 0)];
NSRange r = NSMakeRange(range.location + 1, 0);
[text scrollRangeToVisible:r];
[text setSelectedRange:r];
retval = YES; // causes Apple to NOT fire the default enter action
}
if (commandSelector == @selector(noop:)) {