draw caret permantently during editing...

...or cursor navigation
This commit is contained in:
daboe01
2015-05-17 20:43:18 +02:00
parent e679e760ee
commit 5f0ddeedd0
+9 -1
View File
@@ -676,6 +676,13 @@ var kDelegateRespondsTo_textShouldBeginEditing
- (void)keyDown:(CPEvent)event
{
[self interpretKeyEvents:[event]];
[_caret setPermanentlyVisible:YES];
}
- (void)keyUp:(CPEvent)event
{
[super keyUp:event];
[_caret setPermanentlyVisible:NO];
}
@@ -1890,6 +1897,7 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
@implementation _CPCaret : CPObject
{
BOOL _drawCaret;
BOOL _permanentlyVisible @accessors(property=permanentlyVisible);
CGRect _rect;
CPTextView _textView;
CPTimer _caretTimer;
@@ -1946,7 +1954,7 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
- (void)_blinkCaret:(CPTimer)aTimer
{
_drawCaret = !_drawCaret;
_drawCaret = (!_drawCaret) || _permanentlyVisible;
[_textView setNeedsDisplayInRect:_rect];
}