From abeafde55f9356242c4f74a19adf67ef841c36fb Mon Sep 17 00:00:00 2001
From: Martin Stubenschrott First there was a Navigator, then there was an Explorer. Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor. Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden. Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme. Vimperator was written by Martin Stubenschrott. If you appreciate my work on Vimperator, you can either10h will move 10 times as much to the left.",
+ "Count is supported: 10h will move 10 times as much to the left.
"+
"If the document cannot scroll more, a beep is emmited (unless 'beep' is turned off).",
function(count) { scrollBufferRelative(-1, 0); }
],
diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js
index dd505ace..464a9255 100644
--- a/chrome/content/vimperator/completion.js
+++ b/chrome/content/vimperator/completion.js
@@ -260,23 +260,23 @@ function build_longest_starting_substring(list, filter)/*{{{*/
var filter_length = filter.length;
for (var i = 0; i < list.length; i++)
{
- for (var j = 0; j < list[i][0].length; j++)
+ for (var j = 0; j < list[i][COMMANDS].length; j++)
{
if (list[i][0][j].indexOf(filter) != 0)
continue;
if (g_substrings.length == 0)
{
- var length = list[i][0][j].length;
+ var length = list[i][COMMANDS][j].length;
for (var k = filter_length; k <= length; k++)
- g_substrings.push(list[i][0][j].substring(0, k));
+ g_substrings.push(list[i][COMMANDS][j].substring(0, k));
}
else
{
g_substrings = g_substrings.filter(function($_) {
- return list[i][0][j].indexOf($_) == 0;
+ return list[i][COMMANDS][j].indexOf($_) == 0;
});
}
- filtered.push([list[i][0][j], list[i][1]]);
+ filtered.push([list[i][COMMANDS][j], list[i][SHORTHELP]]);
break;
}
}
@@ -478,12 +478,27 @@ function get_help_completions(filter)/*{{{*/
{
var help_array = [];
g_substrings = [];
- help_array = help_array.concat(g_commands);
- help_array = help_array.concat(get_settings_completions(filter, true));
- help_array = help_array.concat(g_mappings);
+ help_array = help_array.concat(g_commands.map(function($_) {
+ return [
+ $_[COMMANDS].map(function($_) { return ":" + $_; }),
+ $_[SHORTHELP]
+ ];
+ }));
+ settings = get_settings_completions(filter, true);
+ help_array = help_array.concat(settings.map(function($_) {
+ return [
+ $_[COMMANDS].map(function($_) { return "'" + $_ + "'"; }),
+ $_[1]
+ ];
+ }));
+ help_array = help_array.concat(g_mappings.map(function($_) {
+ return [ $_[COMMANDS], $_[SHORTHELP] ];
+ }));
+
if (!filter) return help_array.map(function($_) {
- return [$_[COMMANDS][0], $_[SHORTHELP]];
+ return [$_[COMMANDS][0], $_[1]]; // unfiltered, use the first command
});
+
return build_longest_common_substring(help_array, filter);
}/*}}}*/
diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js
index a058951e..0dec1e2a 100644
--- a/chrome/content/vimperator/help.js
+++ b/chrome/content/vimperator/help.js
@@ -38,35 +38,6 @@ function help(section, easter)
var doc = window.content.document;
- var header = 'Vimperator
' +
- '
'+
- 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)Introduction
' +
- '
' +
- 'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.
'+
- 'If you really need them, type: :set guioptions=mT to get it back.
' +
- 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
' +
- 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.
'+
- 'For best experience, I therefore recommend the Whitehart theme.
'+
- 'send me greetings, patches or make a donation: ' +
-
- '
" +beg+ cmd_name +end+ '' +beg+ cmd_name +end+ 'First there was a Navigator, then there was an Explorer.
'+
+ 'Later it was time for a Konqueror. Now it\'s time for an Imperator, the VIMperator :)
Vimperator is a free browser add-on for Firefox, which makes it look and behave like the Vim text editor.
' +
+ 'It has similar key bindings, and you could call it a modal webbrowser, as key bindings differ according to which mode you are in.
Warning: To provide the most authentic Vim experience, the Firefox menubar and toolbar were hidden.
'+
+ 'If you really need them, type: :set guioptions=mT to get it back.
' +
+ 'If you don\'t like Vimperator at all, you can uninstall it by typing :addons and remove/disable it.
' +
+ 'If you like it, but can\'t remember the shortcuts, press F1 or :help to get this help window back.
Since Vimperator\'s GUI is embedded into a toolbar, it may look too 3D-like with the default theme.
'+
+ 'For best experience, I therefore recommend the Whitehart theme.
Vimperator was written by Martin Stubenschrott. If you appreciate my work on Vimperator, you can either
'+
+ 'send me greetings, patches or make a donation: ' +
+
+ '
The denotion of modifier keys is like in Vim, so C- means the Control key, M- the Meta key, A- the Alt key and S- the Shift key.
'+ '| ' + // should change that to: white-space: pre-wrap; once CSS3 hits firefox header + introduction + mappings + commands + settings + - '' + ' |