Browse Source

Do not execute indentation strategy when pressing Enter inside a read-only section.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@5384 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
pull/1/head
Daniel Grunwald 16 years ago
parent
commit
91c33ed1e4
  1. 6
      src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs

6
src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Editing/TextArea.cs

@ -825,7 +825,11 @@ namespace ICSharpCode.AvalonEdit.Editing @@ -825,7 +825,11 @@ namespace ICSharpCode.AvalonEdit.Editing
ReplaceSelectionWithText(newLine);
if (this.IndentationStrategy != null) {
DocumentLine line = this.Document.GetLineByNumber(this.Caret.Line);
this.IndentationStrategy.IndentLine(this.Document, line);
ISegment[] deletable = GetDeletableSegments(line);
if (deletable.Length == 1 && deletable[0].Offset == line.Offset && deletable[0].Length == line.Length) {
// use indentation strategy only if the line is not read-only
this.IndentationStrategy.IndentLine(this.Document, line);
}
}
}
}

Loading…
Cancel
Save