1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-17 17:23:34 +01:00

simple tab-completion for :javascript and :echo, really just a quick time saver, but prone to errors

This commit is contained in:
Martin Stubenschrott
2007-09-30 00:55:20 +00:00
parent 0173e1e3f5
commit f6a7ac8208
4 changed files with 100 additions and 11 deletions

View File

@@ -523,7 +523,8 @@ function Commands() //{{{
short_help: "Display a string at the bottom of the window",
help: "Useful for showing informational messages. Multiple lines can be separated by \\n.<br/>" +
"<code class=\"argument\">{expr}</code> can either be a quoted string, or any expression which can be fed to eval() like 4+5. " +
"You can also view the source code of objects and functions if the return value of <code class=\"argument\">{expr}</code> is an object or function."
"You can also view the source code of objects and functions if the return value of <code class=\"argument\">{expr}</code> is an object or function.",
completer: function(filter) { return vimperator.completion.javascript(filter); }
}
));
addDefaultCommand(new Command(["echoe[rr]"],
@@ -536,7 +537,8 @@ function Commands() //{{{
{
usage: ["echoe[rr] {expr}"],
short_help: "Display an error string at the bottom of the window",
help: "Just like <code class=\"command\">:ec[ho]</code>, but echoes the result highlighted in red. Useful for showing important messages."
help: "Just like <code class=\"command\">:ec[ho]</code>, but echoes the result highlighted in red. Useful for showing important messages.",
completer: function(filter) { return vimperator.completion.javascript(filter); }
}
));
addDefaultCommand(new Command(["exe[cute]"],
@@ -643,7 +645,11 @@ function Commands() //{{{
help: "Acts as a JavaScript interpreter by passing the argument to <code>eval()</code>.<br/>" +
"<code class=\"command\">:javascript alert('Hello world')</code> would show a dialog box with the text \"Hello world\".<br/>" +
"<code class=\"command\">:javascript &lt;&lt;EOF</code> would read all the lines until a line starting with 'EOF' is found, and will <code>eval()</code> them.<br/>" +
"The special version <code class=\"command\">:javascript!</code> will open the JavaScript console of Firefox."
"The special version <code class=\"command\">:javascript!</code> will open the JavaScript console of Firefox.<br/>" +
"Rudimentary <code class=\"mapping\">&lt;Tab&gt;</code> completion is available for <code class=\"command\">:javascript {cmd}<Tab></code> (but not yet for the " +
"<code class=\"command\">:js &lt;&lt;EOF</code> multiline widget). Be aware that Vimperator needs to run {cmd} through eval() " +
"to get the completions, which could have unwanted side effects.",
completer: function(filter) { return vimperator.completion.javascript(filter); }
}
));
addDefaultCommand(new Command(["let"],
@@ -957,7 +963,7 @@ function Commands() //{{{
"</ol>" +
"You WILL be able to use <code class=\"command\">:open [-T \"linux\"] torvalds&lt;Tab&gt;</code> to complete bookmarks " +
"with tag \"linux\" and which contain \"torvalds\". Note that -T support is only available for tab completion, not for the actual command.<br/>" +
"The items which are completed on <code>&lt;Tab&gt;</code> are specified in the <code class=\"option\">'complete'</code> option.<br/>" +
"The items which are completed on <code class=\"mapping\">&lt;Tab&gt;</code> are specified in the <code class=\"option\">'complete'</code> option.<br/>" +
"Without argument, reloads the current page.<br/>" +
"Without argument but with <code class=\"command\">!</code>, reloads the current page skipping the cache.",
completer: function(filter) { return vimperator.completion.get_url_completions(filter); }