aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html4
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--include/Scintilla.h3
-rw-r--r--include/Scintilla.iface3
-rw-r--r--src/Editor.cxx2
-rw-r--r--src/ViewStyle.cxx5
6 files changed, 17 insertions, 4 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 3b231311a..9ef5b3055 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -3259,6 +3259,10 @@ struct Sci_TextToFind {
for overtype mode is the bar caret (CARETSTYLE_OVERSTRIKE_BAR=0).
You can determine the current caret style setting using <code>SCI_GETCARETSTYLE</code>.</p>
+ <p>When the caret end of a range is at the end and a block caret style is chosen, the block is
+ drawn just inside the selection instead of after.
+ This can be switched with an option (CARETSTYLE_BLOCK_AFTER=256).</p>
+
<p>The block caret draws most combining and multibyte character sequences successfully,
though some fonts like Thai Fonts (and possibly others) can sometimes appear strange when
the cursor is positioned at these characters, which may result in only drawing a part of the
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index dc7bae1fa..868d912c6 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -587,6 +587,10 @@
<a href="https://sourceforge.net/p/scintilla/feature-requests/1293/">Feature #1293</a>.
</li>
<li>
+ Add CARETSTYLE_BLOCK_AFTER option to always display block caret after selection.
+ <a href="https://sourceforge.net/p/scintilla/bugs/1924/">Bug #1924</a>.
+ </li>
+ <li>
On Win32, limit text returned from WM_GETTEXT to the length specified in wParam.
<a href="https://sourceforge.net/p/scintilla/bugs/2110/">Bug #2110</a>.
</li>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 822105975..c7db899d7 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -835,8 +835,9 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define CARETSTYLE_LINE 1
#define CARETSTYLE_BLOCK 2
#define CARETSTYLE_OVERSTRIKE_BAR 0
-#define CARETSTYLE_OVERSTRIKE_BLOCK 16
+#define CARETSTYLE_OVERSTRIKE_BLOCK 0x10
#define CARETSTYLE_INS_MASK 0xF
+#define CARETSTYLE_BLOCK_AFTER 0x100
#define SCI_SETCARETSTYLE 2512
#define SCI_GETCARETSTYLE 2513
#define SCI_SETINDICATORCURRENT 2500
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 8251c5af9..661a6a12b 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -2326,8 +2326,9 @@ val CARETSTYLE_INVISIBLE=0
val CARETSTYLE_LINE=1
val CARETSTYLE_BLOCK=2
val CARETSTYLE_OVERSTRIKE_BAR=0
-val CARETSTYLE_OVERSTRIKE_BLOCK=16
+val CARETSTYLE_OVERSTRIKE_BLOCK=0x10
val CARETSTYLE_INS_MASK=0xF
+val CARETSTYLE_BLOCK_AFTER=0x100
# Set the style of the caret to be drawn.
set void SetCaretStyle=2512(CaretStyle caretStyle,)
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;