aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html10
-rw-r--r--doc/ScintillaHistory.html11
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface2
-rw-r--r--include/ScintillaTypes.h1
-rw-r--r--src/EditView.cxx10
-rw-r--r--src/Editor.cxx2
7 files changed, 31 insertions, 6 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index d432043f6..3189a001a 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -2890,6 +2890,16 @@ struct Sci_TextToFindFull {
<td>A horizontal line stretching until the tabstop.</td>
</tr>
+
+ <tr>
+ <th align="left"><code>SCTD_CONTROLCHAR</code></th>
+
+ <td>2</td>
+
+ <td>Will be drawn as a control code according to the configured
+ <a href="#CharacterRepresentations">character representation</a>
+ without any indentation.</td>
+ </tr>
</tbody>
</table>
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index b91a7e282..26333e1be 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -597,6 +597,17 @@
</table>
<h2 id="Releases">Releases</h2>
<h3>
+ <a href="https://www.scintilla.org/scintilla561.zip">Release 5.6.1</a>
+ </h3>
+ <ul>
+ <li>
+ Released 25 February 2026.
+ </li>
+ <li>
+ Add mode to draw tabs as [HT] blobs with SCI_SETTABDRAWMODE(SCTD_CONTROLCHAR).
+ </li>
+ </ul>
+ <h3>
<a href="https://www.scintilla.org/scintilla560.zip">Release 5.6.0</a>
</h3>
<ul>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index b6786097e..94a66d4f8 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -78,6 +78,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP
#define SCI_SETVIEWWS 2021
#define SCTD_LONGARROW 0
#define SCTD_STRIKEOUT 1
+#define SCTD_CONTROLCHAR 2
#define SCI_GETTABDRAWMODE 2698
#define SCI_SETTABDRAWMODE 2699
#define SCI_POSITIONFROMPOINT 2022
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 6262f7c1b..d98ac8358 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -196,9 +196,11 @@ set void SetViewWS=2021(WhiteSpace viewWS,)
enu TabDrawMode=SCTD_
val SCTD_LONGARROW=0
val SCTD_STRIKEOUT=1
+val SCTD_CONTROLCHAR=2
ali SCTD_LONGARROW=LONG_ARROW
ali SCTD_STRIKEOUT=STRIKE_OUT
+ali SCTD_CONTROLCHAR=CONTROL_CHAR
# Retrieve the current tab draw mode.
# Returns one of SCTD_* constants.
diff --git a/include/ScintillaTypes.h b/include/ScintillaTypes.h
index 0991a1480..a1e55c203 100644
--- a/include/ScintillaTypes.h
+++ b/include/ScintillaTypes.h
@@ -26,6 +26,7 @@ enum class WhiteSpace {
enum class TabDrawMode {
LongArrow = 0,
StrikeOut = 1,
+ ControlChar = 2,
};
enum class EndOfLine {
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 2608f11e5..bec07fe95 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -352,7 +352,7 @@ void LayoutSegments(IPositionCache *pCache,
XYPOSITION representationWidth = 0.0;
// Tab is a special case of representation, taking a variable amount of space
// which will be filled in later.
- if (ll->chars[ts.start] != '\t') {
+ if (ll->chars[ts.start] != '\t' || vstyle.tabDrawMode == TabDrawMode::ControlChar) {
representationWidth = vstyle.controlCharWidth;
if (representationWidth <= 0.0) {
assert(ts.representation->stringRep.length() <= Representation::maxLength);
@@ -522,7 +522,7 @@ void EditView::LayoutLine(const EditModel &model, Surface *surface, const ViewSt
for (const TextSegment &ts : segments) {
if (vstyle.styles[ll->styles[ts.start]].visible &&
ts.representation &&
- (ll->chars[ts.start] == '\t')) {
+ ll->chars[ts.start] == '\t' && vstyle.tabDrawMode != TabDrawMode::ControlChar) {
// Simple visible tab, go to next tab stop
const XYPOSITION startTab = ll->positions[ts.start];
const XYPOSITION nextTab = NextTabstopPos(line, startTab, vstyle.tabWidth);
@@ -610,7 +610,7 @@ void EditView::UpdateBidiData(const EditModel &model, const ViewStyle &vstyle, L
const Representation *repr = model.reprs->RepresentationFromCharacter(std::string_view(&ll->chars[charsInLine], charWidth));
ll->bidiData->widthReprs[charsInLine] = 0.0f;
- if (repr && ll->chars[charsInLine] != '\t') {
+ if (repr && (ll->chars[charsInLine] != '\t' || vstyle.tabDrawMode == TabDrawMode::ControlChar)) {
ll->bidiData->widthReprs[charsInLine] = ll->positions[charsInLine + charWidth] - ll->positions[charsInLine];
}
if (charWidth > 1) {
@@ -1673,7 +1673,7 @@ void DrawBackground(Surface *surface, const EditModel &model, const ViewStyle &v
ColourRGBA textBack = TextBackground(model, vsDraw, ll, background, inSelection,
inHotspot, ll->styles[i], i);
if (ts.representation) {
- if (ll->chars[i] == '\t') {
+ if (ll->chars[i] == '\t' && vsDraw.tabDrawMode != TabDrawMode::ControlChar) {
// Tab display
if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation)) {
textBack = vsDraw.ElementColourForced(Element::WhiteSpaceBack).Opaque();
@@ -2178,7 +2178,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
}
ColourRGBA textBack = TextBackground(model, vsDraw, ll, background, inSelection, inHotspot, styleMain, i);
if (ts.representation) {
- if (ll->chars[i] == '\t') {
+ if (ll->chars[i] == '\t' && vsDraw.tabDrawMode != TabDrawMode::ControlChar) {
// Tab display
if (phasesDraw == PhasesDraw::One) {
if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation))
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 5b42407e3..0289fa5e5 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6984,7 +6984,7 @@ sptr_t Editor::WndProc(Message iMessage, uptr_t wParam, sptr_t lParam) {
return static_cast<sptr_t>(vs.tabDrawMode);
case Message::SetTabDrawMode:
- vs.tabDrawMode = static_cast<TabDrawMode>(wParam);
+ SetAppearance(vs.tabDrawMode, static_cast<TabDrawMode>(wParam));
Redraw();
break;