diff --git a/common/content/commands.js b/common/content/commands.js index 95ce1af8..39b8f453 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -486,7 +486,7 @@ var Commands = Module("commands", { for (let alias in values(names.slice(1))) memoize(this._exMap, alias, closure); - return true; + return name; }, /** diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 870d07b7..3217ede0 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -156,7 +156,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }, addUsageCommand: function (params) { - commands.add(params.name, params.description, + let name = commands.add(params.name, params.description, function (args) { let results = array(params.iterate(args)) .sort(function (a, b) String.localeCompare(a.name, b.name)); @@ -186,7 +186,10 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { }); if (params.index) this.indices[params.index] = function () { - for (let obj in (params.iterateIndex || params.iterate)()) + let results = array((params.iterateIndex || params.iterate).call(params, commands.get(name).newArgs())) + .array.sort(function (a, b) String.localeCompare(a.name, b.name)); + + for (let obj in values(results)) if (obj.helpTag in services["dactyl:"].HELP_TAGS) yield dactyl.generateHelp(obj, null, null, true); } @@ -770,18 +773,23 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { let args = null; if (obj instanceof Command) { - tag = spec = function (cmd) <>:{cmd}; - link = function (cmd) :{cmd}; + link = function (cmd) {cmd}; args = obj.parseArgs("", CompletionContext(str || "")); spec = function (cmd) cmd + (obj.bang ? ! : <>); } - else if (obj instanceof Map && obj.count) { - spec = function (map) <>count{map}; - link = function (map) let (res = /^<(.*?)>(.*?)/.exec(map)) - res ? {res[2]} : {map}; + else if (obj instanceof Map) { + spec = function (map) obj.count ? <>count{map} : <>{map}; + link = function (map) { + let [, mode, name, extra] = /^(?:(.)_)?(?:<([^>]+)>)?(.*)$/.exec(map); + let k = {extra}; + if (name) + k.@name = name; + if (mode) + k.@mode = mode; + return k + } } else if (obj instanceof Option) { - tag = spec = function (opt) <>'{opt}'; link = function (opt) {opt}; } @@ -794,7 +802,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { ; let res = -
{link(obj.name)}
{ +
{link(obj.helpTag || obj.name)}
{ template.linkifyHelp(obj.description ? obj.description.replace(/\.$/, "") : "", true) }
; if (specOnly) diff --git a/common/content/mappings.js b/common/content/mappings.js index d817847a..4c644f66 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -587,7 +587,12 @@ var Mappings = Module("mappings", { dactyl.addUsageCommand({ __proto__: args, name: [mode.char + "listk[eys]", mode.char + "lk"], + iterateIndex: function (args) + let (self = this, prefix = mode.char == "n" ? "" : mode.char + "_") + ({ helpTag: prefix + map.name, __proto__: map } + for (map in self.iterate(args))), description: "List all " + mode.name + " mode mappings along with their short descriptions", + index: mode.char + "-maps", getMode: function (args) mode, options: [] }); diff --git a/common/locale/en-US/index.xml b/common/locale/en-US/index.xml index 5e649d05..899980ca 100644 --- a/common/locale/en-US/index.xml +++ b/common/locale/en-US/index.xml @@ -14,194 +14,15 @@ This file contains a list of all available commands, mappings and options. -

Insert mode

+

Insert mode

-
-
i
Start Insert mode in text areas when insertmode is not set
-
Launch the external editor
-
Enter TextEdit mode
-
Expand an Insert-mode abbreviation
-
+

Normal mode

-

Normal mode

+

Visual mode

-
-
Select the alternate tab or the countth tab
-
Increment last number in URL
-
Scroll up a full page
-
Stop loading the current web page
-
Scroll window downwards in the buffer
-
Scroll down a full page
-
Print the current file name
-
Go to a newer position in the jump list
-
Redraw the screen
-
Go to an older position in the jump list
-
Scroll window upwards in the buffer
-
Pass through next key
-
Decrement last number in URL
-
Temporarily ignore all &dactyl.appName; key bindings
-
+

Command-line editing

-
-
Focus content
-
- -
-
Open the introductory help page
-
Open the single unchunked help page
-
- -
-
Rewind keyboard focus
-
Advance keyboard focus
-
- -
-
0
Scroll to the absolute left of the document
-
$
Scroll to the absolute right of the document
-
- -
-
A
Toggle bookmarked state of current URL
-
B
Show buffer list
-
D
Delete current buffer, focus tab to the left
-
F
Start QuickHint mode, but open link in a new tab
-
G
Go to the end of the document
-
H
Go back in the browser history
-
L
Go forward in the browser history
-
M
Add new QuickMark for current URL
-
N
Find previous
-
O
Open one or more URLs, based on current location
-
P
Open (put) a URL based on the current clipboard contents in a new buffer
-
R
Reload while skipping the cache
-
T
Open one or more URLs in a new tab, based on current location
-
Y
Copy selected text or current word
-
W
Open one or more URLs in a new window, based on current location
-
- -
-
a
Open a prompt to bookmark the current URL
-
b
Open a prompt to switch buffers
-
d
Delete current buffer
-
f
Start QuickHint mode
-
h
Scroll document to the left
-
i
Start Caret mode
-
j
Scroll document down
-
k
Scroll document up
-
l
Scroll document to the right
-
m
Set mark at the cursor position
-
n
Find next
-
o
Open one or more URLs
-
p
Open (put) a URL based on the current clipboard contents in the current buffer
-
q
Record a key sequence into a macro
-
r
Reload the current web page
-
t
Open one or more URLs in a new tab
-
u
Undo closing of a tab
-
y
Yank current location to the clipboard
-
w
Open one or more URLs in a new window
-
- -
-
;
Start an extended hint mode
-
- -
-
:
Enter Command-line mode
-
- -
-
~
Open home directory
-
- -
-
/
Search forward for a pattern
-
?
Search backwards for a pattern
-
*
Find word under cursor
-
#
Find word under cursor backwards
-
- -
-
N%
Scroll to count percent of the document
-
- -
-
'
Jump to the mark
-
- -
-
@
Play a macro
-
- -
-
.
Repeat the last keyboard command
-
@:
Repeat the last Ex command count times
-
- -
-
]f
Focus next frame
-
[f
Focus previous frame
-
]]
Follow the link labeled 'next' or '>' if it exists
-
[[
Follow the link labeled 'prev', 'previous' or '<' if it exists
-
- -
-
g$
Go to the last tab
-
g<
Redisplay the last command output
-
g0
Go to the first tab
-
g<C-g>
Print file information
-
gB
Repeat last :buffer! command in reverse direction
-
gF
View source with an external editor
-
gH
Open homepage in a new tab
-
gP
Open (put) a URL based on the current clipboard contents in a new buffer
-
gT
Go to previous tab
-
gU
Go to the root of the website
-
gb
Repeat last :buffer! command
-
gf
Toggle between rendered and source view
-
gg
Go to the top of the document
-
gh
Open homepage
-
gi
Focus last used input field
-
gn
Jump to a QuickMark in a new tab
-
go
Jump to a QuickMark
-
gt
Go to the next tab
-
gu
Go to parent directory
-
- -
-
ZQ
Quit and don't save the session
-
ZZ
Quit and save the session
-
zI
Enlarge full zoom of current web page
-
zM
Enlarge full zoom of current web page by a larger amount
-
zO
Reduce full zoom of current web page
-
zR
Reduce full zoom of current web page by a larger amount
-
zZ
Set full zoom value of current web page
-
zi
Enlarge text zoom of current web page
-
zm
Enlarge text zoom of current web page by a larger amount
-
zo
Reduce text zoom of current web page
-
zr
Reduce text zoom of current web page by a larger amount
-
zz
Set text zoom value of current web page
-
- -

Command-line editing

- -
-
Quit Command-line mode without executing
-
- -
-
Expand a command-line abbreviation
-
- -
-
Recall the previous command line from the history list which matches the current command line
-
Recall the next command line from the history list which matches the current command line
-
- -
-
Complete the word in front of the cursor according to the behavior specified in wildmode
-
Complete the previous full match when wildmode contains "full"
-
Complete the word in front of the cursor according to the behavior specified in altwildmode
-
Complete the previous full match when altwildmode contains "full"
-
+

Text editing

Ex commands

diff --git a/common/modules/storage.jsm b/common/modules/storage.jsm index 73b21afc..18a701bb 100644 --- a/common/modules/storage.jsm +++ b/common/modules/storage.jsm @@ -347,6 +347,13 @@ var File = Class("File", { return array; }, + /** + * Returns a new nsIFileURL object for this file. + * + * @returns {nsIFileURL} + */ + toURI: function toURI() services.io.newFileURI(this), + /** * Writes the string *buf* to this file. *