1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 22:45:45 +01:00

added section support for :help

This commit is contained in:
Martin Stubenschrott
2007-04-20 21:25:41 +00:00
parent d1b2061145
commit 083aa0ae4a
6 changed files with 64 additions and 10 deletions

View File

@@ -302,6 +302,26 @@ function get_bookmark_completions(filter)/*{{{*/
return filter_url_array(g_bookmarks, filter, true);
}/*}}}*/
function get_help_completions(filter)
{
var help_completions = [];
help_completions = help_completions.concat(get_command_completions(filter));
help_completions = help_completions.concat(get_settings_completions(filter));
for(var i = 0; i < g_mappings.length; i++)
{
for(var j = 0; j < g_mappings[i][0].length; j++)
{
//var re = new RegExp("^" + filter);
if (g_mappings[i][0][j].indexOf(filter) == 0)
{
help_completions.push([g_mappings[i][0][j], g_mappings[i][1]]);
break; // only add a command once
}
}
}
return help_completions;
}
function get_history_completions(filter)/*{{{*/
{
var history = document.getElementById("hiddenHistoryTree");
@@ -372,6 +392,7 @@ function get_command_completions(filter)/*{{{*/
}
// commands should be sorted anyway, but it doesn't really hurt -> it DOES hurt :(
//g_completions.sort();
return g_completions;
}/*}}}*/
function get_settings_completions(filter)/*{{{*/