1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 00:17:58 +01:00

add initial implementation of :normal command

This commit is contained in:
Doug Kearns
2007-08-12 06:48:12 +00:00
parent 27839f303d
commit 5966c57920
3 changed files with 24 additions and 6 deletions

1
NEWS
View File

@@ -1,6 +1,7 @@
<pre> <pre>
2007-08-*: 2007-08-*:
* version 0.5 * version 0.5
* new :normal command
* the command line keeps focus now, even when clicking outside of it * the command line keeps focus now, even when clicking outside of it
* vimperator.events.feedkeys("2zi") support for scripts * vimperator.events.feedkeys("2zi") support for scripts
* Ctrl-U/Ctrl-D for scrolling the window up/down and the associated * Ctrl-U/Ctrl-D for scrolling the window up/down and the associated

View File

@@ -588,7 +588,7 @@ function Commands() //{{{
// 2 args -> map arg1 to arg* // 2 args -> map arg1 to arg*
function(args) function(args)
{ {
if (args.length == 0) if (!args)
{ {
vimperator.mappings.list(vimperator.modes.NORMAL); vimperator.mappings.list(vimperator.modes.NORMAL);
return; return;
@@ -694,6 +694,23 @@ function Commands() //{{{
help: "If <code class=\"argument\">[arg]</code> is specified then limit the list to the those marks mentioned." help: "If <code class=\"argument\">[arg]</code> is specified then limit the list to the those marks mentioned."
} }
)); ));
addDefaultCommand(new Command(["norm[al]"],
function(args)
{
if (!args)
{
vimperator.echoerr("E471: Argument required");
return;
}
vimperator.events.feedkeys(args);
},
{
usage: ["norm[al][!] {commands}"],
short_help: "Execute Normal mode commands",
help: "TODO"
}
));
// TODO: remove duplication in :map // TODO: remove duplication in :map
addDefaultCommand(new Command(["no[remap]"], addDefaultCommand(new Command(["no[remap]"],
// 0 args -> list all maps // 0 args -> list all maps
@@ -701,7 +718,7 @@ function Commands() //{{{
// 2 args -> map arg1 to arg* // 2 args -> map arg1 to arg*
function(args) function(args)
{ {
if (args.length == 0) if (!args)
{ {
vimperator.mappings.list(vimperator.modes.NORMAL); vimperator.mappings.list(vimperator.modes.NORMAL);
return; return;
@@ -1133,7 +1150,7 @@ function Commands() //{{{
addDefaultCommand(new Command(["unm[ap]"], addDefaultCommand(new Command(["unm[ap]"],
function(args) function(args)
{ {
if (args.length == 0) if (!args)
{ {
vimperator.echoerr("E474: Invalid argument"); vimperator.echoerr("E474: Invalid argument");
return; return;
@@ -1194,7 +1211,7 @@ function Commands() //{{{
{ {
var level; var level;
if (args.length == 0) if (!args)
{ {
level = 100; level = 100;
} }

View File

@@ -69,7 +69,7 @@ function CommandLine() //{{{
multiline_output_widget.collapsed = false; multiline_output_widget.collapsed = false;
setTimeout(function() { multiline_output_widget.collapsed = true; }, 0); setTimeout(function() { multiline_output_widget.collapsed = true; }, 0);
// The widget used for multiline iutput // The widget used for multiline intput
var multiline_input_widget = document.getElementById("vimperator-multiline-input"); var multiline_input_widget = document.getElementById("vimperator-multiline-input");
// we need to save the mode which were in before opening the command line // we need to save the mode which were in before opening the command line
@@ -97,7 +97,7 @@ function CommandLine() //{{{
function setMessageStyle() function setMessageStyle()
{ {
prompt_widget.setAttribute("style", "font-family: monospace; color:magenta; font-weight: bold"); prompt_widget.setAttribute("style", "font-family: monospace; color:magenta; font-weight: bold");
command_widget.inputField.setAttribute("style","font-family: monospace;"); command_widget.inputField.setAttribute("style", "font-family: monospace;");
} }
function setErrorStyle() function setErrorStyle()
{ {