From 2aaa8bd253567985c5a1ea5955a3e2dbbcf8fb80 Mon Sep 17 00:00:00 2001 From: JJ Allaire Date: Mon, 27 Jun 2011 17:04:02 -0400 Subject: [PATCH] Revert "Command should be added to history line-by-line" This reverts commit 4819a27c4ee365fa71c68dd9cf648ebeb5a815b4. --- .../workbench/views/console/shell/Shell.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java b/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java index cfacba3a4e7..9a2eabd267f 100644 --- a/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java +++ b/src/gwt/src/org/rstudio/studio/client/workbench/views/console/shell/Shell.java @@ -320,22 +320,14 @@ private void addToHistory(String command) if (command == null) return; - String[] lines = command.split("\n"); - for (String line : lines) + if (history_.size() > 0 + && command.equals(history_.get(history_.size() - 1))) { - // do not allow empty lines - if (line.length() == 0) - return; - - if (history_.size() > 0 - && line.equals(history_.get(history_.size() - 1))) - { - // do not allow dupes - return; - } - - history_.add(line); + // do not allow dupes + return; } + + history_.add(command); } public void onSendToConsole(SendToConsoleEvent event)