From 321b0d95b3acac3bf917db613612c1a9f17acec3 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 26 Aug 2007 14:26:20 +0000 Subject: [PATCH] fix commandline history on Windows - prevent the default cmd_charPrevious action from being invoked for --- NEWS | 2 ++ chrome/content/vimperator/ui.js | 15 +++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index cf50868c..3bd416b3 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,8 @@
 2007-xx-xx:
 	* version 0.6
+	* commandline history now works properly on Windows
+	* filename completion now works on Windows
 	* Fixed search for :open (previously needed to do :o  ONCE to initialize them)
 	* added :set {option}! support to toggle a boolean option's value
 	* added :set all and :set all& support to show the current value of all
diff --git a/chrome/content/vimperator/ui.js b/chrome/content/vimperator/ui.js
index 2f87d4be..3fa02b6e 100644
--- a/chrome/content/vimperator/ui.js
+++ b/chrome/content/vimperator/ui.js
@@ -355,24 +355,32 @@ function CommandLine() //{{{
             /* user pressed UP or DOWN arrow to cycle history completion */
             else if (key == "" || key == "")
             {
-                //always reset the tab completion if we use up/down keys
+                event.preventDefault();
+                event.stopPropagation();
+
+                // always reset the tab completion if we use up/down keys
                 completion_index = UNINITIALIZED;
 
-                /* save 'start' position for iterating through the history */
+                // save 'start' position for iterating through the history
                 if (history_index == UNINITIALIZED)
                 {
                     history_index = history.length;
                     history_start = command;
                 }
 
+                // search the history for the first item matching the current
+                // commandline string
                 while (history_index >= -1 && history_index <= history.length)
                 {
                     key == "" ? history_index-- : history_index++;
-                    if (history_index == history.length) // user pressed DOWN when there is no newer history item
+
+                    // user pressed DOWN when there is no newer history item
+                    if (history_index == history.length)
                     {
                         setCommand(history_start);
                         return;
                     }
+
                     // cannot go past history start/end
                     if (history_index <= -1)
                     {
@@ -393,7 +401,6 @@ function CommandLine() //{{{
                         return;
                     }
                 }
-                vimperator.beep();
             }
 
             /* user pressed TAB to get completions of a command */