mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 23:47:57 +01:00
add an initial implementation of :sidebar
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,6 +1,7 @@
|
|||||||
<pre>
|
<pre>
|
||||||
2007-XX-XX:
|
2007-XX-XX:
|
||||||
* version 0.5.2
|
* version 0.5.2
|
||||||
|
* added a new :sidebar command
|
||||||
* added 'more' and standard more-prompt key mappings to control
|
* added 'more' and standard more-prompt key mappings to control
|
||||||
behaviour of the message list pager
|
behaviour of the message list pager
|
||||||
* added 'hlsearchstyle' option to allow for user CSS styling of the
|
* added 'hlsearchstyle' option to allow for user CSS styling of the
|
||||||
|
|||||||
@@ -1076,6 +1076,32 @@ function Commands() //{{{
|
|||||||
completer: function(filter) { return vimperator.completion.get_options_completions(filter); }
|
completer: function(filter) { return vimperator.completion.get_options_completions(filter); }
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
addDefaultCommand(new Command(["sideb[ar]"],
|
||||||
|
function(args)
|
||||||
|
{
|
||||||
|
if (!args)
|
||||||
|
{
|
||||||
|
vimperator.echoerr("E471: Argument required");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var menu = document.getElementById("viewSidebarMenu")
|
||||||
|
|
||||||
|
for (var i = 0; i < menu.childNodes.length; i++)
|
||||||
|
{
|
||||||
|
if (menu.childNodes[i].label == args)
|
||||||
|
{
|
||||||
|
eval(menu.childNodes[i].getAttribute('oncommand'))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
short_help: "Open the sidebar",
|
||||||
|
help: "TODO",
|
||||||
|
completer: function(filter) { return vimperator.completion.get_sidebar_completions(filter); }
|
||||||
|
}
|
||||||
|
));
|
||||||
addDefaultCommand(new Command(["so[urce]"],
|
addDefaultCommand(new Command(["so[urce]"],
|
||||||
function(args)
|
function(args)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -461,6 +461,17 @@ vimperator.completion = (function() // {{{
|
|||||||
return build_longest_common_substring(items, filter);
|
return build_longest_common_substring(items, filter);
|
||||||
}, //}}}
|
}, //}}}
|
||||||
|
|
||||||
|
get_sidebar_completions: function(filter) //{{{
|
||||||
|
{
|
||||||
|
var menu = document.getElementById("viewSidebarMenu")
|
||||||
|
var nodes = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < menu.childNodes.length; i++)
|
||||||
|
nodes.push([[menu.childNodes[i].label], ""]);
|
||||||
|
|
||||||
|
return build_longest_starting_substring(nodes, filter);
|
||||||
|
}, //}}}
|
||||||
|
|
||||||
exTabCompletion: function(str) //{{{
|
exTabCompletion: function(str) //{{{
|
||||||
{
|
{
|
||||||
var [count, cmd, special, args] = vimperator.commands.parseCommand(str);
|
var [count, cmd, special, args] = vimperator.commands.parseCommand(str);
|
||||||
|
|||||||
Reference in New Issue
Block a user