fixed scroll when there was too much text

This commit is contained in:
Jeena Paradies 2012-11-02 02:30:04 +01:00
parent 45be91f33f
commit f57ed62432

View file

@ -143,6 +143,9 @@
if (commandSelector == @selector(insertNewline:)) {
retval = YES; // causes Apple to NOT fire the default enter action
textField.stringValue = [NSString stringWithFormat:@"%@\n", textField.stringValue];
[[[textField window] fieldEditor:YES forObject:nil] scrollRangeToVisible:NSMakeRange([[textField stringValue] length], 0)];
[[[textField window] fieldEditor:YES forObject:nil] setSelectedRange:NSMakeRange([[textField stringValue] length], 0)];
}
if (commandSelector == @selector(noop:)) {