diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 9a7e3d77..9a2d53cd 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -72,17 +72,15 @@ function Command(specs, action, extra_info) //{{{ this.action = action; + // TODO: build a better default usage string + this.usage = this.specs; + if (extra_info) { //var flags = extra_info.flags || 0; if (extra_info.usage) this.usage = extra_info.usage; - else - { - // TODO: build a default usage string -- djk - this.usage = this.name; - } this.help = extra_info.help || null; this.short_help = extra_info.short_help || null; diff --git a/chrome/content/vimperator/mappings.js b/chrome/content/vimperator/mappings.js index f0dc0602..263a38e9 100644 --- a/chrome/content/vimperator/mappings.js +++ b/chrome/content/vimperator/mappings.js @@ -35,6 +35,8 @@ function Map(mode, cmds, act, extra_info) //{{{ this.names = cmds; this.action = act; + this.usage = [this.names[0]]; + if (extra_info) { this.flags = extra_info.flags || 0; @@ -43,10 +45,9 @@ function Map(mode, cmds, act, extra_info) //{{{ this.usage = extra_info.usage; else { - this.usage = ""; + this.usage = this.names[0]; // only the first command name if (this.flags & Mappings.flags.COUNT) - this.usage = "{count}"; - this.usage += this.names[0]; // only the first command name + this.usage = "{count}" + this.usage; if (this.flags & Mappings.flags.ARGUMENT) this.usage += " {arg}"; this.usage = [this.usage]; // FIXME: usage an array - needed for the help @@ -54,6 +55,7 @@ function Map(mode, cmds, act, extra_info) //{{{ this.help = extra_info.help || null; this.short_help = extra_info.short_help || null; + // TODO: are these limited to HINTS mode? // Only set for hints maps this.cancel_mode = extra_info.cancel_mode || false;