diff --git a/chrome/content/vimperator/commands.js b/chrome/content/vimperator/commands.js index 83aa1ec2..021a3fcc 100644 --- a/chrome/content/vimperator/commands.js +++ b/chrome/content/vimperator/commands.js @@ -356,7 +356,7 @@ var g_commands = [/*{{{*/ ["tab"], ["tab {cmd}"], "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.
" + "Example: :tab help tab opens the help in a new tab.", tab, null @@ -1914,9 +1914,11 @@ function set(args, special) function source(filename, silent) { + if (!filename) return; try { var fd = fopen(filename, "<"); + if (!fd) return; var s = fd.read(); fd.close(); diff --git a/chrome/content/vimperator/completion.js b/chrome/content/vimperator/completion.js index 82ab768c..dd505ace 100644 --- a/chrome/content/vimperator/completion.js +++ b/chrome/content/vimperator/completion.js @@ -471,7 +471,7 @@ function get_file_completions(filter)/*{{{*/ 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)/*{{{*/ diff --git a/chrome/content/vimperator/file.js b/chrome/content/vimperator/file.js index df96f35e..5c48cceb 100644 --- a/chrome/content/vimperator/file.js +++ b/chrome/content/vimperator/file.js @@ -87,10 +87,14 @@ function LocalFile(file, mode, perms, tmp) { this.localFile = classes[LOCALFILE_CTRID].createInstance(nsILocalFile); this.localFile.initWithPath(file); + if (!this.localFile.exists()) + throw "No such file or directory"; } else if (file instanceof nsILocalFile) { this.localFile = file; + if (!this.localFile.exists()) + throw "No such file or directory"; } else { diff --git a/chrome/content/vimperator/help.js b/chrome/content/vimperator/help.js index 212b7c45..2c29fa76 100644 --- a/chrome/content/vimperator/help.js +++ b/chrome/content/vimperator/help.js @@ -33,7 +33,7 @@ function help(section, easter) echoerr("E478: Don't panic!"); return; } - if (arguments[3] && arguments[3].inTab) + if ((arguments[3] && arguments[3].inTab) || !window.content.document.open) openURLsInNewTab("", true); var doc = window.content.document;