diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp index 82b63d0373c3..d153a1e819f5 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.cpp @@ -2358,7 +2358,8 @@ void ScintillaEditView::activateBuffer(BufferID buffer, bool force) restoreCurrentPosPreStep(); - runMarkers(true, 0, true, false); + //runMarkers(true, 0, true, false); + restoreHiddenLines(); setCRLF(); @@ -4226,6 +4227,30 @@ void ScintillaEditView::runMarkers(bool doHide, size_t searchStart, bool endOfDo } } +void ScintillaEditView::restoreHiddenLines() +{ + int line = 0; + + while (line != -1) + { + line = static_cast(execute(SCI_MARKERNEXT, line, 1 << MARK_HIDELINESBEGIN)); + + if (line != -1) + { + int startHiding = line + 1; + line = static_cast(execute(SCI_MARKERNEXT, line, 1 << MARK_HIDELINESEND)); + + if (line != -1) + { + execute(SCI_HIDELINES, startHiding, line - 1); + + } + } + } +} + + + void ScintillaEditView::setTabSettings(Lang* lang) { diff --git a/PowerEditor/src/ScintillaComponent/ScintillaEditView.h b/PowerEditor/src/ScintillaComponent/ScintillaEditView.h index ae715d509b89..72a10c2ac8dd 100644 --- a/PowerEditor/src/ScintillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScintillaComponent/ScintillaEditView.h @@ -815,6 +815,7 @@ friend class Finder; bool markerMarginClick(intptr_t lineNumber); //true if it did something void notifyMarkers(Buffer * buf, bool isHide, size_t location, bool del); void runMarkers(bool doHide, size_t searchStart, bool endOfDoc, bool doDelete); + void restoreHiddenLines(); bool hasSelection() const { return !execute(SCI_GETSELECTIONEMPTY); };