aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--doc/ScintillaDoc.html14
-rw-r--r--doc/ScintillaHistory.html5
-rw-r--r--include/Scintilla.h2
-rw-r--r--include/Scintilla.iface6
-rw-r--r--src/Editor.cxx7
5 files changed, 33 insertions, 1 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index b96f6eea2..c99e5509c 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -3912,8 +3912,11 @@ struct Sci_TextToFind {
inserting a tab at the current character position and backspace unindents the line rather than
deleting a character. Scintilla can also display indentation guides (vertical lines) to help
you to generate code.</p>
- <code><a class="message" href="#SCI_SETTABWIDTH">SCI_SETTABWIDTH(int tabWidth)</a><br />
+ <code>
+ <a class="message" href="#SCI_SETTABWIDTH">SCI_SETTABWIDTH(int tabWidth)</a><br />
<a class="message" href="#SCI_GETTABWIDTH">SCI_GETTABWIDTH &rarr; int</a><br />
+ <a class="message" href="#SCI_SETTABMINIMUMWIDTH">SCI_SETTABMINIMUMWIDTH(int pixels)</a><br />
+ <a class="message" href="#SCI_GETTABMINIMUMWIDTH">SCI_GETTABMINIMUMWIDTH &rarr; int</a><br />
<a class="message" href="#SCI_CLEARTABSTOPS">SCI_CLEARTABSTOPS(line line)</a><br />
<a class="message" href="#SCI_ADDTABSTOP">SCI_ADDTABSTOP(line line, int x)</a><br />
<a class="message" href="#SCI_GETNEXTTABSTOP">SCI_GETNEXTTABSTOP(line line, int x) &rarr; int</a><br />
@@ -3936,6 +3939,15 @@ struct Sci_TextToFind {
<a class="message" href="#SCI_GETHIGHLIGHTGUIDE">SCI_GETHIGHLIGHTGUIDE &rarr; position</a><br />
</code>
+ <p><b id="SCI_SETTABMINIMUMWIDTH">SCI_SETTABMINIMUMWIDTH(int pixels)</b><br />
+ <b id="SCI_GETTABMINIMUMWIDTH">SCI_GETTABMINIMUMWIDTH &rarr; int</b><br />
+ <code>SCI_SETTABMINIMUMWIDTH</code> sets the minimum size of a tab in pixels to ensure that the tab
+ can be seen. The default value is 2. This is particularly useful with proportional fonts with fractional widths where
+ the character before the tab may end a fraction of a pixel before a tab stop, causing the tab to only be a fraction of
+ a pixel wide without this setting.
+ Where displaying a miniaturized version of the document, setting this to 0 may make the miniaturized
+ version lay out more like the normal size version.</p>
+
<p><b id="SCI_SETTABWIDTH">SCI_SETTABWIDTH(int tabWidth)</b><br />
<b id="SCI_GETTABWIDTH">SCI_GETTABWIDTH &rarr; int</b><br />
<code>SCI_SETTABWIDTH</code> sets the size of a tab as a multiple of the size of a space
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 30bb32a5c..ca8665b7c 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -565,6 +565,11 @@
Released 5 July 2019.
</li>
<li>
+ Add SCI_SETTABMINIMUMWIDTH to set the minimum width of tabs.
+ This allows minimaps or overviews to be layed out to match the full size editing view.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2118/">Bug #2118</a>.
+ </li>
+ <li>
SciTE enables use of SCI_ commands in user.context.menu.
</li>
<li>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 808ad9985..40a2c8eca 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -93,6 +93,8 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SCI_SETBUFFEREDDRAW 2035
#define SCI_SETTABWIDTH 2036
#define SCI_GETTABWIDTH 2121
+#define SCI_SETTABMINIMUMWIDTH 2724
+#define SCI_GETTABMINIMUMWIDTH 2725
#define SCI_CLEARTABSTOPS 2675
#define SCI_ADDTABSTOP 2676
#define SCI_GETNEXTTABSTOP 2677
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index 8107ae47c..3f270c86c 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -252,6 +252,12 @@ set void SetTabWidth=2036(int tabWidth,)
# Retrieve the visible size of a tab.
get int GetTabWidth=2121(,)
+# Set the minimum visual width of a tab.
+set void SetTabMinimumWidth=2724(int pixels,)
+
+# Get the minimum visual width of a tab.
+get int GetTabMinimumWidth=2725(,)
+
# Clear explicit tabstops on a line.
fun void ClearTabStops=2675(line line,)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 2cf12f61f..dbcafeb89 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -6534,6 +6534,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_GETTABWIDTH:
return pdoc->tabInChars;
+ case SCI_SETTABMINIMUMWIDTH:
+ SetAppearance(view.tabWidthMinimumPixels, static_cast<int>(wParam));
+ break;
+
+ case SCI_GETTABMINIMUMWIDTH:
+ return view.tabWidthMinimumPixels;
+
case SCI_CLEARTABSTOPS:
if (view.ClearTabstops(static_cast<Sci::Line>(wParam))) {
const DocModification mh(SC_MOD_CHANGETABSTOPS, 0, 0, 0, nullptr, static_cast<Sci::Line>(wParam));