Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1203)

Unified Diff: runtime/observatory/lib/src/cli/command.dart

Issue 2312553002: Converted Observatory debugger elements (Closed)
Patch Set: Sharing command history and console Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/observatory/lib/src/app/page.dart ('k') | runtime/observatory/lib/src/debugger/debugger.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/cli/command.dart
diff --git a/runtime/observatory/lib/src/cli/command.dart b/runtime/observatory/lib/src/cli/command.dart
index 04ff48e3735683fb865227dd9fd245cbbe9a9c84..b9eebb02173de66b2928900d91903e77120c8c35 100644
--- a/runtime/observatory/lib/src/cli/command.dart
+++ b/runtime/observatory/lib/src/cli/command.dart
@@ -115,7 +115,13 @@ abstract class _CommandBase {
// The root of a tree of commands.
class RootCommand extends _CommandBase {
- RootCommand(List<Command> children) : super(children);
+ RootCommand(List<Command> children, [List<String> history])
+ : this._(children, history ?? ['']);
+
+ RootCommand._(List<Command> children, List<String> history)
+ : history = history,
+ historyPos = history.length - 1,
+ super(children);
// Provides a list of possible completions for a line of text.
Future<List<String>> completeCommand(String line) {
@@ -191,8 +197,8 @@ class RootCommand extends _CommandBase {
// Command line history always contains one slot to hold the current
// line, so we start off with one entry.
- List<String> history = [''];
- int historyPos = 0;
+ List<String> history;
+ int historyPos;
String historyPrev(String line) {
if (historyPos == 0) {
« no previous file with comments | « runtime/observatory/lib/src/app/page.dart ('k') | runtime/observatory/lib/src/debugger/debugger.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698