Browse Source

Prevent fold markers from disappearing if they have no text (fixes SD2-977)

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1643 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 19 years ago
parent
commit
cf06a3a000
  1. 5
      src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/FoldingStrategy/FoldMarker.cs

5
src/Libraries/ICSharpCode.TextEditor/Project/Src/Document/FoldingStrategy/FoldMarker.cs

@ -121,6 +121,11 @@ namespace ICSharpCode.TextEditor.Document @@ -121,6 +121,11 @@ namespace ICSharpCode.TextEditor.Document
endLine = Math.Min(document.TotalNumberOfLines - 1, Math.Max(endLine, 0));
ISegment endLineSegment = document.GetLineSegment(endLine);
// Prevent the region from completely disappearing
if (string.IsNullOrEmpty(foldText)) {
foldText = "...";
}
this.FoldType = foldType;
this.foldText = foldText;
this.offset = startLineSegment.Offset + Math.Min(startColumn, startLineSegment.Length);

Loading…
Cancel
Save