diff options
-rw-r--r-- | doc/ScintillaDoc.html | 10 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | include/Scintilla.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 1 | ||||
-rw-r--r-- | src/Editor.cxx | 21 |
5 files changed, 28 insertions, 9 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index b8789801f..a97aa6858 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -82,7 +82,7 @@ <h1>Scintilla Documentation</h1> - <p>Last edited 16 April 2014 NH</p> + <p>Last edited 21 April 2014 NH</p> <p>There is <a class="jump" href="Design.html">an overview of the internal design of Scintilla</a>.<br /> @@ -5421,6 +5421,14 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ <td align="left">display hexadecimal fold levels in line margin to aid debugging of folding. The appearance of this feature may change in the future.</td> </tr> + + <tr> + <td align="left">SC_FOLDFLAG_LINESTATE</td> + <td align="left">128</td> + + <td align="left">display hexadecimal line state in line margin to aid debugging of lexing and folding. + May not be used at the same time as <code>SC_FOLDFLAG_LEVELNUMBERS</code>.</td> + </tr> </tbody> </table> diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index 0f0434da9..dc78adfd4 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -470,6 +470,10 @@ SC_MOD_INSERTCHECK. </li> <li> + Line state may be displayed in the line number margin to aid in debugging lexing and folding with + SC_FOLDFLAG_LINESTATE (128). + </li> + <li> C++ lexer can highlight task marker keywords in comments as SCE_C_TASKMARKER. </li> <li> diff --git a/include/Scintilla.h b/include/Scintilla.h index ea2c12bc1..f8744c1c0 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -462,6 +462,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam, #define SC_FOLDFLAG_LINEAFTER_EXPANDED 0x0008 #define SC_FOLDFLAG_LINEAFTER_CONTRACTED 0x0010 #define SC_FOLDFLAG_LEVELNUMBERS 0x0040 +#define SC_FOLDFLAG_LINESTATE 0x0080 #define SCI_SETFOLDFLAGS 2233 #define SCI_ENSUREVISIBLEENFORCEPOLICY 2234 #define SCI_SETTABINDENTS 2260 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index 78cec5731..276ba8dd7 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -1154,6 +1154,7 @@ val SC_FOLDFLAG_LINEBEFORE_CONTRACTED=0x0004 val SC_FOLDFLAG_LINEAFTER_EXPANDED=0x0008 val SC_FOLDFLAG_LINEAFTER_CONTRACTED=0x0010 val SC_FOLDFLAG_LEVELNUMBERS=0x0040 +val SC_FOLDFLAG_LINESTATE=0x0080 # Set some style options for folding. set void SetFoldFlags=2233(int flags,) diff --git a/src/Editor.cxx b/src/Editor.cxx index aaa440dce..d11de5e72 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2048,14 +2048,19 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) { char number[100] = ""; if (lineDoc >= 0) sprintf(number, "%d", lineDoc + 1); - if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { - int lev = pdoc->GetLevel(lineDoc); - sprintf(number, "%c%c %03X %03X", - (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', - (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', - lev & SC_FOLDLEVELNUMBERMASK, - lev >> 16 - ); + if (foldFlags & (SC_FOLDFLAG_LEVELNUMBERS | SC_FOLDFLAG_LINESTATE)) { + if (foldFlags & SC_FOLDFLAG_LEVELNUMBERS) { + int lev = pdoc->GetLevel(lineDoc); + sprintf(number, "%c%c %03X %03X", + (lev & SC_FOLDLEVELHEADERFLAG) ? 'H' : '_', + (lev & SC_FOLDLEVELWHITEFLAG) ? 'W' : '_', + lev & SC_FOLDLEVELNUMBERMASK, + lev >> 16 + ); + } else { + int state = pdoc->GetLineState(lineDoc); + sprintf(number, "%0X", state); + } } PRectangle rcNumber = rcMarker; // Right justify |