Skip to content
This repository was archived by the owner on Mar 10, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions LPMultiLineTextField.j
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ var CPTextFieldInputOwner = nil;
{
if (_stringValue !== [self stringValue])
{
[[[[self window] undoManager] prepareWithInvocationTarget:self] setStringValue:_stringValue];
_stringValue = [self stringValue];

if (!_isEditing)
Expand All @@ -207,14 +208,7 @@ var CPTextFieldInputOwner = nil;
- (BOOL)becomeFirstResponder
{
_stringValue = [self stringValue];

[self setThemeState:CPThemeStateEditing];

setTimeout(function(){
[self _DOMTextareaElement].focus();
CPTextFieldInputOwner = self;
}, 0.0);

[self textDidFocus:[CPNotification notificationWithName:CPTextFieldDidFocusNotification object:self userInfo:nil]];

return YES;
Expand Down Expand Up @@ -250,6 +244,8 @@ var CPTextFieldInputOwner = nil;

- (void)setStringValue:(CPString)aString
{
if(_stringValue != aString)
[[[[self window] undoManager] prepareWithInvocationTarget:self] setStringValue:_stringValue];
_stringValue = aString;
[self setNeedsLayout];
}
Expand Down