Reset edit targets

This commit is contained in:
Matthias Neeracher 2011-09-11 01:23:38 +02:00
parent 7dc46ea1de
commit 8917b3d7cc

View File

@ -845,6 +845,7 @@ const float kSemiFloor = -1.0f*kLineH;
BOOL extend = ([event modifierFlags] & NSShiftKeyMask) != 0; BOOL extend = ([event modifierFlags] & NSShiftKeyMask) != 0;
switch ([self findRegionForEvent:event]) { switch ([self findRegionForEvent:event]) {
case kRegionNote: case kRegionNote:
[self setEditTarget:nil];
fSelEnd = -1; fSelEnd = -1;
[self addNoteAtCursor]; [self addNoteAtCursor];
break; break;
@ -861,9 +862,11 @@ const float kSemiFloor = -1.0f*kLineH;
} }
break; break;
case kRegionMeasure: case kRegionMeasure:
[self setEditTarget:nil];
[self editSelection:extend]; [self editSelection:extend];
break; break;
default: default:
[self setEditTarget:nil];
fSelEnd = -1; fSelEnd = -1;
break; break;
} }
@ -929,6 +932,9 @@ const float kSemiFloor = -1.0f*kLineH;
case NSBacktabTextMovement: case NSBacktabTextMovement:
[editable moveToPrev]; [editable moveToPrev];
break; break;
case NSReturnTextMovement:
[self setEditTarget:nil];
// Fall through
default: default:
fHighlightStanza = 0xFFFFFFFF; fHighlightStanza = 0xFFFFFFFF;
editable = nil; editable = nil;