From f30e3460821d39e5f3c568b4fecfc108d00dab3f Mon Sep 17 00:00:00 2001 From: Henrik Hank Date: Wed, 6 Jun 2018 08:55:59 +1000 Subject: SC_WRAPINDENT_DEEPINDENT added to indent two tabs from previous line. --- doc/ScintillaDoc.html | 14 +++++++++++--- doc/ScintillaHistory.html | 4 ++++ include/Scintilla.h | 1 + include/Scintilla.iface | 1 + src/EditView.cxx | 12 +++++++++--- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index aed82bbc0..8a8eddbff 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -119,7 +119,7 @@

Scintilla Documentation

-

Last edited 2 June 2018 NH

+

Last edited 6 June 2018 NH

There is an overview of the internal design of Scintilla.
@@ -6429,8 +6429,10 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ SC_WRAPINDENT_FIXED 0 - Wrapped sublines aligned to left of window plus amount set by - SCI_SETWRAPSTARTINDENT + + Wrapped sublines aligned to left of window plus amount set by + SCI_SETWRAPSTARTINDENT + @@ -6444,6 +6446,12 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ 2 Wrapped sublines are aligned to first subline indent plus one more level of indentation + + + SC_WRAPINDENT_DEEPINDENT + 3 + Wrapped sublines are aligned to first subline indent plus two more levels of indentation + diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index e903e8f3a..3e0db69be 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -529,6 +529,7 @@ Giuseppe Corbelli Andreas Rönnquist + Henrik Hank

@@ -561,6 +562,9 @@ to fully transparent at top and bottom.

  • + Wrap indent mode SC_WRAPINDENT_DEEPINDENT added which indents two tabs from previous line. +
  • +
  • Indicators are drawn for line end characters when displayed.
  • diff --git a/include/Scintilla.h b/include/Scintilla.h index 58f58f43f..db4524f12 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 ee23c4db2..8b08f4d2f 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 46eda5d3b..e09e55de9 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -521,10 +521,16 @@ void EditView::LayoutLine(const EditModel &model, Sci::Line line, Surface *surfa width -= static_cast(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) -- cgit v1.2.3