1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 20:27:58 +01:00
'tag' command works once more
  'source ~/' shows the matches
  fdopen checks whether the file exists, and throws a more-readable error if it doesn't
  'help' work if the current document is a XULDocument (it shows the help in a new tab)
This commit is contained in:
Viktor Kojouharov
2007-04-28 09:52:29 +00:00
parent 4cc50bf40e
commit bfcf598bf2
4 changed files with 9 additions and 3 deletions

View File

@@ -356,7 +356,7 @@ var g_commands = [/*{{{*/
["tab"], ["tab"],
["tab {cmd}"], ["tab {cmd}"],
"Execute {cmd} and tell it to output in a new tab", "Execute {cmd} and tell it to output in a new tab",
"Works for only commands that support it.", "Works for only commands that support it.<br/>" +
"Example: <code class=command>:tab help tab</code> opens the help in a new tab.", "Example: <code class=command>:tab help tab</code> opens the help in a new tab.",
tab, tab,
null null
@@ -1914,9 +1914,11 @@ function set(args, special)
function source(filename, silent) function source(filename, silent)
{ {
if (!filename) return;
try try
{ {
var fd = fopen(filename, "<"); var fd = fopen(filename, "<");
if (!fd) return;
var s = fd.read(); var s = fd.read();
fd.close(); fd.close();

View File

@@ -471,7 +471,7 @@ function get_file_completions(filter)/*{{{*/
return [[path], '']; return [[path], ''];
}); });
return g_completions = build_longest_starting_substring(mapped, filter); return g_completions = build_longest_starting_substring(mapped, new_filter);
}/*}}}*/ }/*}}}*/
function get_help_completions(filter)/*{{{*/ function get_help_completions(filter)/*{{{*/

View File

@@ -87,10 +87,14 @@ function LocalFile(file, mode, perms, tmp)
{ {
this.localFile = classes[LOCALFILE_CTRID].createInstance(nsILocalFile); this.localFile = classes[LOCALFILE_CTRID].createInstance(nsILocalFile);
this.localFile.initWithPath(file); this.localFile.initWithPath(file);
if (!this.localFile.exists())
throw "No such file or directory";
} }
else if (file instanceof nsILocalFile) else if (file instanceof nsILocalFile)
{ {
this.localFile = file; this.localFile = file;
if (!this.localFile.exists())
throw "No such file or directory";
} }
else else
{ {

View File

@@ -33,7 +33,7 @@ function help(section, easter)
echoerr("E478: Don't panic!"); echoerr("E478: Don't panic!");
return; return;
} }
if (arguments[3] && arguments[3].inTab) if ((arguments[3] && arguments[3].inTab) || !window.content.document.open)
openURLsInNewTab("", true); openURLsInNewTab("", true);
var doc = window.content.document; var doc = window.content.document;