// // ReturnNewLineTextField.m // RubyFrictionless // // Created by Pierce T. Wetter III on 3/24/08. // Copyright 2008 __MyCompanyName__. All rights reserved. // #import "ReturnNewLineTextFieldDelegate.h" @implementation ReturnNewLineTextFieldDelegate - (BOOL)control:(NSControl*)control textView:(NSTextView*)textView doCommandBySelector:(SEL)commandSelector { BOOL result = NO; if (commandSelector == @selector(insertNewline:)) { // new line action: // always insert a line-break character and don’t cause the receiver to end editing [textView insertNewlineIgnoringFieldEditor:self]; result = YES; } /*else if (commandSelector == @selector(insertTab:)) { // tab action: // always insert a tab character and don’t cause the receiver to end editing [textView insertTabIgnoringFieldEditor:self]; result = YES; }*/ return result; } @end