diff options
author | Neil <nyamatongwe@gmail.com> | 2019-06-22 10:51:29 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2019-06-22 10:51:29 +1000 |
commit | 1573a0d60a3cf054979125c7986566d13a6686d3 (patch) | |
tree | d11ebaac9ad05da5826300ecb20d7f24a7e7453a /src | |
parent | 8aa1cae911d5323f2e435c37ef5132c90f16ed55 (diff) | |
download | scintilla-mirror-1573a0d60a3cf054979125c7986566d13a6686d3.tar.gz |
Bug [#1924]. Option to allow block carets to trail selection ranges.
Bit flag value is CARETSTYLE_BLOCK_AFTER=256.
Diffstat (limited to 'src')
-rw-r--r-- | src/Editor.cxx | 2 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index 497d92050..92c77571e 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -7323,7 +7323,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return vs.caretcolour.AsInteger(); case SCI_SETCARETSTYLE: - if (wParam <= (CARETSTYLE_BLOCK | CARETSTYLE_OVERSTRIKE_BLOCK)) + if (wParam <= (CARETSTYLE_BLOCK | CARETSTYLE_OVERSTRIKE_BLOCK | CARETSTYLE_BLOCK_AFTER)) vs.caretStyle = static_cast<int>(wParam); else /* Default to the line caret */ diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 65c4f2f8e..e75184488 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -546,10 +546,13 @@ bool ViewStyle::SetWrapIndentMode(int wrapIndentMode_) noexcept { } bool ViewStyle::IsBlockCaretStyle() const noexcept { - return (caretStyle == CARETSTYLE_BLOCK) || (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0; + return ((caretStyle & CARETSTYLE_INS_MASK) == CARETSTYLE_BLOCK) || + (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0; } bool ViewStyle::DrawCaretInsideSelection(bool inOverstrike, bool imeCaretBlockOverride) const noexcept { + if (caretStyle & CARETSTYLE_BLOCK_AFTER) + return false; return ((caretStyle & CARETSTYLE_INS_MASK) == CARETSTYLE_BLOCK) || (inOverstrike && (caretStyle & CARETSTYLE_OVERSTRIKE_BLOCK) != 0) || imeCaretBlockOverride; |