aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHenrik Hank <unknown>2018-06-06 08:55:59 +1000
committerHenrik Hank <unknown>2018-06-06 08:55:59 +1000
commit2cfe83dc91dbbdd195b17b5446ce595f0c658db2 (patch)
tree89439af44aff139af5579281200c48fa9c1e1e20
parentc823cbe5c809df5f84a2ef0b867a0733f7568cf0 (diff)
downloadscintilla-mirror-2cfe83dc91dbbdd195b17b5446ce595f0c658db2.tar.gz
Backport: SC_WRAPINDENT_DEEPINDENT added to indent two tabs from previous line.
Backport of changeset 7024:72c92ed3dc10.
-rw-r--r--doc/ScintillaDoc.html14
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--include/Scintilla.h1
-rw-r--r--include/Scintilla.iface1
-rw-r--r--src/EditView.cxx12
5 files changed, 26 insertions, 6 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html
index 01d2ae108..41ece6fa9 100644
--- a/doc/ScintillaDoc.html
+++ b/doc/ScintillaDoc.html
@@ -116,7 +116,7 @@
<h1>Scintilla Documentation</h1>
- <p>Last edited 17 April 2018 NH</p>
+ <p>Last edited 6 June 2018 NH</p>
<p>There is <a class="jump" href="Design.html">an overview of the internal design of
Scintilla</a>.<br />
@@ -6402,8 +6402,10 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<tr>
<td align="left"><code>SC_WRAPINDENT_FIXED</code></td>
<td align="center">0</td>
- <td>Wrapped sublines aligned to left of window plus amount set by
- <a class="seealso" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT</a></td>
+ <td>
+ Wrapped sublines aligned to left of window plus amount set by
+ <a class="seealso" href="#SCI_SETWRAPSTARTINDENT">SCI_SETWRAPSTARTINDENT</a>
+ </td>
</tr>
<tr>
@@ -6417,6 +6419,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){
<td align="center">2</td>
<td>Wrapped sublines are aligned to first subline indent plus one more level of indentation</td>
</tr>
+
+ <tr>
+ <td align="left"><code>SC_WRAPINDENT_DEEPINDENT</code></td>
+ <td align="center">3</td>
+ <td>Wrapped sublines are aligned to first subline indent plus two more levels of indentation</td>
+ </tr>
</tbody>
</table>
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 9b1b9241c..e91c51501 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -523,6 +523,7 @@
<td>Nicholai Benalal</td>
</tr><tr>
<td>Andreas Rönnquist</td>
+ <td>Henrik Hank</td>
</tr>
</table>
<p>
@@ -561,6 +562,9 @@
to fully transparent at top and bottom.
</li>
<li>
+ Wrap indent mode SC_WRAPINDENT_DEEPINDENT added which indents two tabs from previous line.
+ </li>
+ <li>
Indicators are drawn for line end characters when displayed.
</li>
<li>
diff --git a/include/Scintilla.h b/include/Scintilla.h
index 4b93e4507..70f17918b 100644
--- a/include/Scintilla.h
+++ b/include/Scintilla.h
@@ -548,6 +548,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
#define SC_WRAPINDENT_FIXED 0
#define SC_WRAPINDENT_SAME 1
#define SC_WRAPINDENT_INDENT 2
+#define SC_WRAPINDENT_DEEPINDENT 3
#define SCI_SETWRAPINDENTMODE 2472
#define SCI_GETWRAPINDENTMODE 2473
#define SC_CACHE_NONE 0
diff --git a/include/Scintilla.iface b/include/Scintilla.iface
index d4d8ac78b..d7f7d68e3 100644
--- a/include/Scintilla.iface
+++ b/include/Scintilla.iface
@@ -1359,6 +1359,7 @@ enu WrapIndentMode=SC_WRAPINDENT_
val SC_WRAPINDENT_FIXED=0
val SC_WRAPINDENT_SAME=1
val SC_WRAPINDENT_INDENT=2
+val SC_WRAPINDENT_DEEPINDENT=3
# Sets how wrapped sublines are placed. Default is fixed.
set void SetWrapIndentMode=2472(int wrapIndentMode,)
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 7616324f1..10a264d27 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -522,10 +522,16 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa
width -= static_cast<int>(vstyle.aveCharWidth); // take into account the space for end wrap mark
}
XYPOSITION wrapAddIndent = 0; // This will be added to initial indent of line
- if (vstyle.wrapIndentMode == SC_WRAPINDENT_INDENT) {
- wrapAddIndent = model.pdoc->IndentSize() * vstyle.spaceWidth;
- } else if (vstyle.wrapIndentMode == SC_WRAPINDENT_FIXED) {
+ switch (vstyle.wrapIndentMode) {
+ case SC_WRAPINDENT_FIXED:
wrapAddIndent = vstyle.wrapVisualStartIndent * vstyle.aveCharWidth;
+ break;
+ case SC_WRAPINDENT_INDENT:
+ wrapAddIndent = model.pdoc->IndentSize() * vstyle.spaceWidth;
+ break;
+ case SC_WRAPINDENT_DEEPINDENT:
+ wrapAddIndent = model.pdoc->IndentSize() * 2 * vstyle.spaceWidth;
+ break;
}
ll->wrapIndent = wrapAddIndent;
if (vstyle.wrapIndentMode != SC_WRAPINDENT_FIXED)