From 1b955a332fdea892683764467ca64f0704e98dab Mon Sep 17 00:00:00 2001 From: Zufu Liu Date: Thu, 19 Mar 2020 08:53:15 +1100 Subject: Feature [feature-requests:1302] Add IsCaretVisible to simplify DrawCarets. --- src/ViewStyle.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ViewStyle.cxx') diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index e75184488..30a77f872 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -550,6 +550,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; -- cgit v1.2.3