Browse Source

Prevent user from deleting the console pad prompt.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@3202 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 18 years ago
parent
commit
c6c5cf6b4a
  1. 6
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/ConsolePad.cs

6
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Pads/ConsolePad.cs

@ -61,6 +61,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -61,6 +61,7 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
this.Document.Insert(this.Document.TextLength, "> ");
this.ActiveTextAreaControl.Caret.Position = this.Document.OffsetToPosition(this.Document.TextLength);
this.Document.UndoStack.ClearAll(); // prevent user from undoing the prompt insertion
}
string GetLastLineText()
@ -73,7 +74,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads @@ -73,7 +74,12 @@ namespace ICSharpCode.SharpDevelop.Gui.Pads
{
// All lines except the last one are read-only
int codeStart = this.Document.PositionToOffset(new TextLocation(2, this.Document.LineSegmentCollection.Count - 1));
// make document read-only if caret is before codeStart or there is a selection before codeStart
this.Document.ReadOnly = (this.ActiveTextAreaControl.Caret.Offset < codeStart);
foreach (ISelection selection in this.ActiveTextAreaControl.SelectionManager.SelectionCollection) {
if (selection.Offset < codeStart)
this.Document.ReadOnly = true;
}
if (keys == Keys.Back) {
if (this.ActiveTextAreaControl.Caret.Offset <= codeStart) {

Loading…
Cancel
Save