aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-12-07 10:22:43 +1100
committerNeil <nyamatongwe@gmail.com>2014-12-07 10:22:43 +1100
commite4b87d6fbb4239e6a8123211b5570059fd9827ac (patch)
treec03c888ec1a3d83cf928b346c67319569980bee1
parentd1db597843009f3b7be35396a377ffec280dd5d0 (diff)
downloadscintilla-mirror-e4b87d6fbb4239e6a8123211b5570059fd9827ac.tar.gz
Protect FineTickerCancel from being called when fine tickers not implemented.
Use ShowCaretAtCurrentPosition which understands focus in preference to DropCaret where possible.
-rw-r--r--src/Editor.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index b85055202..0fba257be 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1333,7 +1333,9 @@ void Editor::ShowCaretAtCurrentPosition() {
void Editor::DropCaret() {
caret.active = false;
- FineTickerCancel(tickCaret);
+ if (FineTickerAvailable()) {
+ FineTickerCancel(tickCaret);
+ }
InvalidateCaret();
}
@@ -3290,7 +3292,6 @@ int Editor::KeyCommand(unsigned int iMessage) {
break;
case SCI_EDITTOGGLEOVERTYPE:
inOverstrike = !inOverstrike;
- DropCaret();
ShowCaretAtCurrentPosition();
ContainerNeedsUpdate(SC_UPDATE_CONTENT);
NotifyUpdateUI();
@@ -4678,12 +4679,10 @@ void Editor::FineTickerCancel(TickReason) {
void Editor::SetFocusState(bool focusState) {
hasFocus = focusState;
NotifyFocus(hasFocus);
- if (hasFocus) {
- ShowCaretAtCurrentPosition();
- } else {
+ if (!hasFocus) {
CancelModes();
- DropCaret();
}
+ ShowCaretAtCurrentPosition();
}
int Editor::PositionAfterArea(PRectangle rcArea) const {