void CompleteCommand() { string head_text = command_text; int format_width = 0; string[] completion_buffer = Autocomplete.Complete(ref head_text, ref format_width); int completion_length = completion_buffer.Length; if (completion_length != 0) { command_text = head_text; } if (completion_length > 1) { // Print possible completions var log_buffer = new StringBuilder(); foreach (string completion in completion_buffer) { log_buffer.Append(completion.PadRight(format_width + 4)); } Log("{0}", log_buffer); scroll_position.y = int.MaxValue; } }
void CompleteCommand() { string head = this.commandText; int formatWidth = 0; string[] completionBuffer = Autocomplete.Complete(ref head, ref formatWidth); int completionLength = completionBuffer.Length; if (completionLength != 0) { this.commandText = head; } if (completionLength > 1) { var logBuffer = new StringBuilder(); foreach (string completion in completionBuffer) { logBuffer.Append(completion.PadRight(formatWidth + 4)); } Log("{0}", logBuffer); this.scrollPosition.y = int.MaxValue; } }
void CompleteCommand() { string head_text = command_text; string[] completion_buffer = Autocomplete.Complete(ref head_text); int completion_length = completion_buffer.Length; if (completion_length == 1) { command_text = head_text + completion_buffer[0]; } else if (completion_length > 1) { // Print possible completions Log(string.Join(" ", completion_buffer)); scroll_position.y = int.MaxValue; } }
public void CompleteCommand() { string head_text = command_text; int format_width = 0; string[] completion_buffer = Autocomplete.Complete(ref head_text, ref format_width); int completion_length = completion_buffer.Length; if (completion_length != 0) { command_text = head_text; } if (completion_length >= 1) { // Print possible completions var log_buffer = new StringBuilder(); for (int i = 0; i < completion_buffer.Length; i++) { if (i == completion_buffer.Length - 1) { log_buffer.Append(completion_buffer[i]); } // 9 commands to a line else if ((i + 1) % 9 == 0) { log_buffer.Append(completion_buffer[i] + "\n"); } else { log_buffer.Append(completion_buffer[i].PadRight(format_width + 4)); } } Log("{0}", log_buffer); } }