Imported Upstream version 4.6.0.125

Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2016-08-03 10:59:49 +00:00
parent a569aebcfd
commit e79aa3c0ed
17047 changed files with 3137615 additions and 392334 deletions

View File

@ -462,7 +462,7 @@ namespace Mono.Terminal {
Console.ForegroundColor = selected ? ConsoleColor.Black : ConsoleColor.Gray;
Console.BackgroundColor = selected ? ConsoleColor.Cyan : ConsoleColor.Blue;
var item = Prefix + Completions [item_idx];
if (item.Length > Width)
item = item.Substring (0, Width);
@ -490,7 +490,7 @@ namespace Mono.Terminal {
{
if (selected_item+1 < Completions.Length){
selected_item++;
if (selected_item + top_item >= Height)
if (selected_item - top_item >= Height)
top_item++;
SaveExcursion (DrawSelection);
}
@ -1419,7 +1419,15 @@ namespace Mono.Terminal {
class Demo {
static void Main ()
{
LineEditor le = new LineEditor ("foo");
LineEditor le = new LineEditor ("foo") {
HeuristicsMode = "csharp"
};
le.AutoCompleteEvent += delegate (string a, int pos){
string prefix = "";
var completions = new string [] { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten" };
return new Mono.Terminal.LineEditor.Completion (prefix, completions);
};
string s;
while ((s = le.Edit ("shell> ", "")) != null){