aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html8
-rw-r--r--doc/ScintillaHistory.html1
-rw-r--r--include/Scintilla.h2
-rw-r--r--include/Scintilla.iface6
-rw-r--r--src/Editor.cxx12
-rw-r--r--src/ViewStyle.cxx2
-rw-r--r--src/ViewStyle.h1
7 files changed, 30 insertions, 2 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 99320a947..afce3aa88 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -2603,6 +2603,8 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_GETCARETLINEBACK">SCI_GETCARETLINEBACK</a><br />
<a class="message" href="#SCI_SETCARETLINEBACKALPHA">SCI_SETCARETLINEBACKALPHA(int alpha)</a><br />
<a class="message" href="#SCI_GETCARETLINEBACKALPHA">SCI_GETCARETLINEBACKALPHA</a><br />
+ <a class="message" href="#SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</a><br />
+ <a class="message" href="#SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS</a><br />
<a class="message" href="#SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</a><br />
<a class="message" href="#SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</a><br />
<a class="message" href="#SCI_SETCARETSTYLE">SCI_SETCARETSTYLE(int style)</a><br />
@@ -2667,6 +2669,12 @@ struct Sci_TextToFind {
the caret line is drawn after all other features so will affect the colour of all other features.
</p>
+ <p><b id="SCI_SETCARETLINEVISIBLEALWAYS">SCI_SETCARETLINEVISIBLEALWAYS(bool alwaysVisible)</b><br />
+ <b id="SCI_GETCARETLINEVISIBLEALWAYS">SCI_GETCARETLINEVISIBLEALWAYS</b><br />
+ Choose to make the caret line always visible even when the window is not in focus.
+ Default behaviour <code>SCI_SETCARETLINEVISIBLEALWAYS(false)</code> the caret line is only visible when the window is in focus.
+ </p>
+
<p><b id="SCI_SETCARETPERIOD">SCI_SETCARETPERIOD(int milliseconds)</b><br />
<b id="SCI_GETCARETPERIOD">SCI_GETCARETPERIOD</b><br />
The rate at which the caret blinks can be set with <code>SCI_SETCARETPERIOD</code> which
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index c514c39d7..442e6df57 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -414,6 +414,7 @@
<td>Sakshi Verma</td>
<td>Joel B. Mohler</td>
<td>Isiledhel</td>
+ <td>Vidya Wasi</td>
</tr>
</table>
<p>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 67a44e24a..029102641 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -853,6 +853,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_FINDINDICATORHIDE 2642
#define SCI_VCHOMEDISPLAY 2652
#define SCI_VCHOMEDISPLAYEXTEND 2653
+#define SCI_GETCARETLINEVISIBLEALWAYS 2654
+#define SCI_SETCARETLINEVISIBLEALWAYS 2655
#define SCI_STARTRECORD 3001
#define SCI_STOPRECORD 3002
#define SCI_SETLEXER 4001
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 2937480a0..d6df3cc9d 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -2267,6 +2267,12 @@ fun void VCHomeDisplay=2652(,)
# Like VCHomeDisplay but extending selection to new caret position.
fun void VCHomeDisplayExtend=2653(,)
+# Is the caret line always visible?
+get bool GetCaretLineVisibleAlways=2654(,)
+
+# Sets the caret line to always visible.
+set void SetCaretLineVisibleAlways=2655(bool alwaysVisible,)
+
# Start notifying the container of all key presses and commands.
fun void StartRecord=3001(,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index bb23e9e6d..34c195f3e 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -2743,7 +2743,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// the color for the highest numbered one is used.
bool overrideBackground = false;
ColourDesired background;
- if (caret.active && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
+ if ((caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && (vsDraw.caretLineAlpha == SC_ALPHA_NOALPHA) && ll->containsCaret) {
overrideBackground = true;
background = vsDraw.caretLineBackground;
}
@@ -3193,7 +3193,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// Draw any translucent whole line states
rcSegment = rcLine;
- if (caret.active && vsDraw.showCaretLineBackground && ll->containsCaret) {
+ if ((caret.active || vsDraw.alwaysShowCaretLineBackground) && vsDraw.showCaretLineBackground && ll->containsCaret) {
SimpleAlphaRectangle(surface, rcSegment, vsDraw.caretLineBackground, vsDraw.caretLineAlpha);
}
marks = pdoc->GetMark(line);
@@ -3738,6 +3738,7 @@ long Editor::FormatRange(bool draw, Sci_RangeToFormat *pfr) {
vsPrint.whitespaceBackgroundSet = false;
vsPrint.whitespaceForegroundSet = false;
vsPrint.showCaretLineBackground = false;
+ vsPrint.alwaysShowCaretLineBackground = false;
// Don't highlight matching braces using indicators
vsPrint.braceHighlightIndicatorSet = false;
vsPrint.braceBadLightIndicatorSet = false;
@@ -8321,6 +8322,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
vs.showCaretLineBackground = wParam != 0;
InvalidateStyleRedraw();
break;
+ case SCI_GETCARETLINEVISIBLEALWAYS:
+ return vs.alwaysShowCaretLineBackground;
+ case SCI_SETCARETLINEVISIBLEALWAYS:
+ vs.alwaysShowCaretLineBackground = wParam != 0;
+ InvalidateStyleRedraw();
+ break;
+
case SCI_GETCARETLINEBACK:
return vs.caretLineBackground.AsLong();
case SCI_SETCARETLINEBACK:
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index a4894ef58..9df8152a1 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -180,6 +180,7 @@ ViewStyle::ViewStyle(const ViewStyle &source) {
caretcolour = source.caretcolour;
additionalCaretColour = source.additionalCaretColour;
showCaretLineBackground = source.showCaretLineBackground;
+ alwaysShowCaretLineBackground = source.alwaysShowCaretLineBackground;
caretLineBackground = source.caretLineBackground;
caretLineAlpha = source.caretLineAlpha;
edgecolour = source.edgecolour;
@@ -274,6 +275,7 @@ void ViewStyle::Init(size_t stylesSize_) {
caretcolour = ColourDesired(0, 0, 0);
additionalCaretColour = ColourDesired(0x7f, 0x7f, 0x7f);
showCaretLineBackground = false;
+ alwaysShowCaretLineBackground = false;
caretLineBackground = ColourDesired(0xff, 0xff, 0);
caretLineAlpha = SC_ALPHA_NOALPHA;
edgecolour = ColourDesired(0xc0, 0xc0, 0xc0);
diff --git a/src/ViewStyle.h b/src/ViewStyle.h
index 292ed01ec..25467052f 100644
--- a/src/ViewStyle.h
+++ b/src/ViewStyle.h
@@ -115,6 +115,7 @@ public:
ColourDesired caretcolour;
ColourDesired additionalCaretColour;
bool showCaretLineBackground;
+ bool alwaysShowCaretLineBackground;
ColourDesired caretLineBackground;
int caretLineAlpha;
ColourDesired edgecolour;