diff options
-rw-r--r-- | doc/ScintillaDoc.html | 13 | ||||
-rw-r--r-- | doc/ScintillaHistory.html | 1 | ||||
-rw-r--r-- | include/Scintilla.h | 1 | ||||
-rw-r--r-- | include/Scintilla.iface | 1 | ||||
-rw-r--r-- | include/ScintillaTypes.h | 1 | ||||
-rw-r--r-- | src/EditView.cxx | 11 |
6 files changed, 28 insertions, 0 deletions
diff --git a/doc/ScintillaDoc.html b/doc/ScintillaDoc.html index 511632937..b38cfb83c 100644 --- a/doc/ScintillaDoc.html +++ b/doc/ScintillaDoc.html @@ -3504,6 +3504,14 @@ struct Sci_TextToFind { <td></td> <td>Colour of fold lines</td> </tr> + <tr> + <th align="left"><code>SC_ELEMENT_HIDDEN_LINE</code></th> + <td>81</td> + <td>Translucent</td> + <td>All</td> + <td></td> + <td>Colour of line drawn to show there are lines hidden at that point</td> + </tr> </tbody> </table> @@ -7008,6 +7016,7 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ <a class="message" href="#SCI_DOCLINEFROMVISIBLE">SCI_DOCLINEFROMVISIBLE(line displayLine) → line</a><br /> <a class="message" href="#SCI_SHOWLINES">SCI_SHOWLINES(line lineStart, line lineEnd)</a><br /> <a class="message" href="#SCI_HIDELINES">SCI_HIDELINES(line lineStart, line lineEnd)</a><br /> + <a class="element" href="#SC_ELEMENT_HIDDEN_LINE">SC_ELEMENT_HIDDEN_LINE : colouralpha</a><br /> <a class="message" href="#SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(line line) → bool</a><br /> <a class="message" href="#SCI_GETALLLINESVISIBLE">SCI_GETALLLINESVISIBLE → bool</a><br /> <a class="message" href="#SCI_SETFOLDLEVEL">SCI_SETFOLDLEVEL(line line, int level)</a><br /> @@ -7059,10 +7068,14 @@ sptr_t CallScintilla(unsigned int iMessage, uptr_t wParam, sptr_t lParam){ <p><b id="SCI_SHOWLINES">SCI_SHOWLINES(line lineStart, line lineEnd)</b><br /> <b id="SCI_HIDELINES">SCI_HIDELINES(line lineStart, line lineEnd)</b><br /> + <b id="SC_ELEMENT_HIDDEN_LINE">SC_ELEMENT_HIDDEN_LINE : colouralpha</b><br /> <b id="SCI_GETLINEVISIBLE">SCI_GETLINEVISIBLE(line line) → bool</b><br /> <b id="SCI_GETALLLINESVISIBLE">SCI_GETALLLINESVISIBLE → bool</b><br /> The first two messages mark a range of lines as visible or invisible and then redraw the display. + If <a class="element" href="#SCI_SETELEMENTCOLOUR"><code>SC_ELEMENT_HIDDEN_LINE</code></a> + is set then a horizontal line is drawn in that colour to indicate that there are hidden lines. + A fold line drawn in that position overrides the hidden line indicator. <code>SCI_GETLINEVISIBLE</code> reports on the visible state of a line and returns 1 if it is visible and 0 if it is not visible. <code>SCI_GETALLLINESVISIBLE</code> returns 1 if all lines are visible and 0 diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index f0c6ded0b..21f44f476 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -576,6 +576,7 @@ </li> <li> Add SC_ELEMENT_FOLD_LINE to set the colour of fold lines. + Add SC_ELEMENT_HIDDEN_LINE to show where lines are hidden. </li> <li> Fix display of fold lines when wrapped so they are only drawn once per line, not on each subline. diff --git a/include/Scintilla.h b/include/Scintilla.h index 3af22dfc5..3a6e301b3 100644 --- a/include/Scintilla.h +++ b/include/Scintilla.h @@ -292,6 +292,7 @@ typedef sptr_t (*SciFnDirectStatus)(sptr_t ptr, unsigned int iMessage, uptr_t wP #define SC_ELEMENT_HOT_SPOT_ACTIVE 70 #define SC_ELEMENT_HOT_SPOT_ACTIVE_BACK 71 #define SC_ELEMENT_FOLD_LINE 80 +#define SC_ELEMENT_HIDDEN_LINE 81 #define SCI_SETELEMENTCOLOUR 2753 #define SCI_GETELEMENTCOLOUR 2754 #define SCI_RESETELEMENTCOLOUR 2755 diff --git a/include/Scintilla.iface b/include/Scintilla.iface index d8a1bdec1..837e4d841 100644 --- a/include/Scintilla.iface +++ b/include/Scintilla.iface @@ -698,6 +698,7 @@ val SC_ELEMENT_WHITE_SPACE_BACK=61 val SC_ELEMENT_HOT_SPOT_ACTIVE=70 val SC_ELEMENT_HOT_SPOT_ACTIVE_BACK=71 val SC_ELEMENT_FOLD_LINE=80 +val SC_ELEMENT_HIDDEN_LINE=81 # Set the colour of an element. Translucency (alpha) may or may not be significant # and this may depend on the platform. The alpha byte should commonly be 0xff for opaque. diff --git a/include/ScintillaTypes.h b/include/ScintillaTypes.h index ab4a55131..910cd5ec8 100644 --- a/include/ScintillaTypes.h +++ b/include/ScintillaTypes.h @@ -181,6 +181,7 @@ enum class Element { HotSpotActive = 70, HotSpotActiveBack = 71, FoldLine = 80, + HiddenLine = 81, }; enum class Layer { diff --git a/src/EditView.cxx b/src/EditView.cxx index 7eea729fd..e32e791ec 100644 --- a/src/EditView.cxx +++ b/src/EditView.cxx @@ -2304,6 +2304,17 @@ static void DrawFoldLines(Surface *surface, const EditModel &model, const ViewSt || (!expanded && (FlagSet(model.foldFlags, FoldFlag::LineAfterContracted))))) { surface->FillRectangleAligned(Side(rcLine, Edge::bottom, 1.0), foldLineColour); + // If contracted fold line drawn then don't overwrite with hidden line + // as fold lines are more specific then hidden lines. + if (!expanded) { + return; + } + } + } + if (lastSubLine && model.pcs->GetVisible(line) && !model.pcs->GetVisible(line + 1)) { + std::optional<ColourRGBA> hiddenLineColour = vsDraw.ElementColour(Element::HiddenLine); + if (hiddenLineColour) { + surface->FillRectangleAligned(Side(rcLine, Edge::bottom, 1.0), *hiddenLineColour); } } } |