aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ViewStyle.cxx
diff options
context:
space:
mode:
authorZufu Liu <unknown>2020-03-19 08:53:15 +1100
committerZufu Liu <unknown>2020-03-19 08:53:15 +1100
commit63fcc3edaf7ca501fdf7d6d98bb0a5de24939f71 (patch)
treeddcef2af54c9c3d3ab4cc1b9adec80df78808f49 /src/ViewStyle.cxx
parentd37556bb750b9e03263036ea2e6afe4ee8dab79a (diff)
downloadscintilla-mirror-63fcc3edaf7ca501fdf7d6d98bb0a5de24939f71.tar.gz
Backport: Feature [feature-requests:1302] Add IsCaretVisible to simplify DrawCarets.
Backport of changeset 8010:4b365fa302a2.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r--src/ViewStyle.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index 6ec980af4..43b48544c 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -549,6 +549,10 @@ bool ViewStyle::IsBlockCaretStyle() const noexcept {
(caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0;
}
+bool ViewStyle::IsCaretVisible() const noexcept {
+ return caretWidth > 0 && caretStyle != CARETSTYLE_INVISIBLE;
+}
+
bool ViewStyle::DrawCaretInsideSelection(bool inOverstrike, bool imeCaretBlockOverride) const noexcept {
if (caretStyle & CARETSTYLE_BLOCK_AFTER)
return false;