aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/EditModel.cxx1
-rw-r--r--src/EditModel.h1
-rw-r--r--src/Editor.cxx5
-rw-r--r--src/Editor.h1
4 files changed, 6 insertions, 2 deletions
diff --git a/src/EditModel.cxx b/src/EditModel.cxx
index d84ad7e21..35a2bc549 100644
--- a/src/EditModel.cxx
+++ b/src/EditModel.cxx
@@ -66,6 +66,7 @@ EditModel::EditModel() : braces{} {
braces[1] = Sci::invalidPosition;
bracesMatchStyle = STYLE_BRACEBAD;
highlightGuideColumn = 0;
+ hasFocus = false;
primarySelection = true;
imeInteraction = IMEInteraction::windowed;
bidirectional = Bidirectional::bidiDisabled;
diff --git a/src/EditModel.h b/src/EditModel.h
index 8d30267f0..e2f3e20e0 100644
--- a/src/EditModel.h
+++ b/src/EditModel.h
@@ -33,6 +33,7 @@ public:
Sci::Position braces[2];
int bracesMatchStyle;
int highlightGuideColumn;
+ bool hasFocus;
Selection sel;
bool primarySelection;
diff --git a/src/Editor.cxx b/src/Editor.cxx
index adc9f3492..59d5d54e6 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -122,7 +122,6 @@ Editor::Editor() : durationWrapOneLine(0.00001, 0.000001, 0.0001) {
cursorMode = SC_CURSORNORMAL;
- hasFocus = false;
errorStatus = 0;
mouseDownCaptures = true;
mouseWheelCaptures = true;
@@ -5072,7 +5071,11 @@ void Editor::FineTickerCancel(TickReason) {
}
void Editor::SetFocusState(bool focusState) {
+ const bool changing = hasFocus != focusState;
hasFocus = focusState;
+ if (changing) {
+ Redraw();
+ }
NotifyFocus(hasFocus);
if (!hasFocus) {
CancelModes();
diff --git a/src/Editor.h b/src/Editor.h
index 1ee6be643..eabd7517e 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -188,7 +188,6 @@ protected: // ScintillaBase subclass needs access to much of Editor
int cursorMode;
- bool hasFocus;
bool mouseDownCaptures;
bool mouseWheelCaptures;