diff options
author | Zufu Liu <unknown> | 2019-02-05 09:02:14 +1100 |
---|---|---|
committer | Zufu Liu <unknown> | 2019-02-05 09:02:14 +1100 |
commit | 1469ac92b931c4e43046964116fcc4a0ae73100c (patch) | |
tree | 2f838871632d3accae0474302a436967992beaaa /src/ViewStyle.cxx | |
parent | dceb72247c99932399784780437344934260b11d (diff) | |
download | scintilla-mirror-1469ac92b931c4e43046964116fcc4a0ae73100c.tar.gz |
Feature [feature-requests:#1217]. Change API so block just for overstrike.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r-- | src/ViewStyle.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index ec923c382..148163bec 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -572,6 +572,19 @@ bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) { return changed; } +bool ViewStyle::IsBlockCaretStyle() const noexcept { + return (caretStyle == CARETSTYLE_BLOCK) || (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0; +} + +ViewStyle::CaretShape ViewStyle::CaretShapeForMode(bool inOverstrike) const noexcept { + if (inOverstrike) { + return (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) ? CaretShape::block : CaretShape::bar; + } + + const int caret = caretStyle & CARETSTYLE_INS_MASK; + return (caret <= CARETSTYLE_BLOCK) ? static_cast<CaretShape>(caret) : CaretShape::line; +} + void ViewStyle::AllocStyles(size_t sizeNew) { size_t i=styles.size(); styles.resize(sizeNew); |