Author: gonzalo
Date: 2006-10-06 19:33:48 -0400 (Fri, 06 Oct 2006)
New Revision: 66383
Modified:
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/TermInfoDriver.cs
Log:
2006-10-06 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* TermInfoDriver.cs: don't allow backspace if we're at the beginning
position for a ReadLine.
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2006-10-06 23:25:13 UTC (rev
66382)
+++ trunk/mcs/class/corlib/System/ChangeLog 2006-10-06 23:33:48 UTC (rev
66383)
@@ -1,5 +1,10 @@
2006-10-06 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+ * TermInfoDriver.cs: don't allow backspace if we're at the beginning
+ position for a ReadLine.
+
+2006-10-06 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
* TermInfoDriver.cs: ironpython autocompletion works now.
2006-09-28 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/corlib/System/TermInfoDriver.cs
===================================================================
--- trunk/mcs/class/corlib/System/TermInfoDriver.cs 2006-10-06 23:25:13 UTC
(rev 66382)
+++ trunk/mcs/class/corlib/System/TermInfoDriver.cs 2006-10-06 23:33:48 UTC
(rev 66383)
@@ -79,6 +79,7 @@
Hashtable keymap;
ByteMatcher rootmap;
bool home_1_1; // if true, we have to add 1 to x and y when
using cursorAddress
+ int rl_startx = -1, rl_starty = -1;
#if DEBUG
StreamWriter logger;
#endif
@@ -282,6 +283,8 @@
switch (key.Key) {
case ConsoleKey.Backspace:
if (cursorLeft > 0) {
+ if (cursorLeft <= rl_startx &&
cursorTop == rl_starty)
+ return false;
cursorLeft--;
SetCursorPosition (cursorLeft,
cursorTop);
WriteConsole (" ");
@@ -704,6 +707,8 @@
StringBuilder builder = new StringBuilder ();
bool exit = false;
CStreamWriter writer = (CStreamWriter) Console.stdout;
+ rl_startx = cursorLeft;
+ rl_starty = cursorLeft;
do {
ConsoleKeyInfo key = ReadKeyInternal ();
char c = key.KeyChar;
@@ -714,6 +719,8 @@
} while (!exit);
if (prevEcho == false)
Echo = prevEcho;
+ rl_startx = -1;
+ rl_starty = -1;
return builder.ToString ();
}
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches