diff --git a/NEWS b/NEWS index 78d23c0e..de02edee 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,7 @@ * version 0.6 * THIS VERSION ONLY WORKS WITH FIREFOX 3.0 * you can edit textfields with Ctrl-i now using an external editor (thanks to Joseph Xu) - * :open,:bmarks,etc. filter on space seperated tokens now, so you can + * :open, :bmarks, etc. filter on space separated tokens now, so you can search with :open linux windows <tab> all your bookmarks/history which contain linux AND windows in the url or title * tags and keyword support for :bmark diff --git a/content/io.js b/content/io.js index e6d5eaed..84fe8118 100644 --- a/content/io.js +++ b/content/io.js @@ -86,16 +86,6 @@ vimperator.io = (function() return path; }, - // path can also be a filename, not limited to directories - pathExists: function(path) - { - var p = Components.classes["@mozilla.org/file/local;1"] - .createInstance(Components.interfaces.nsILocalFile); - p.initWithPath(this.expandPath(path)); - - return p.exists(); - }, - getPluginDir: function() { var plugin_dir; @@ -105,22 +95,22 @@ vimperator.io = (function() else plugin_dir = "~/.vimperator/plugin"; - plugin_dir = this.expandPath(plugin_dir); + plugin_dir = this.getFile(this.expandPath(plugin_dir)); - return this.pathExists(plugin_dir) ? plugin_dir : null; + return plugin_dir.exists() && plugin_dir.isDirectory() ? plugin_dir : null; }, getRCFile: function() { - var rc_file1 = this.expandPath("~/.vimperatorrc"); - var rc_file2 = this.expandPath("~/_vimperatorrc"); + var rc_file1 = this.getFile(this.expandPath("~/.vimperatorrc")); + var rc_file2 = this.getFile(this.expandPath("~/_vimperatorrc")); if (navigator.platform == "Win32") [rc_file1, rc_file2] = [rc_file2, rc_file1] - if (this.pathExists(rc_file1)) + if (rc_file1.exists() && rc_file1.isFile()) return rc_file1; - else if (this.pathExists(rc_file2)) + else if (rc_file2.exists() && rc_file2.isFile()) return rc_file2; else return null; diff --git a/content/vimperator.js b/content/vimperator.js index 14b3c418..ee4915e2 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -636,7 +636,7 @@ const vimperator = (function() //{{{ var rc_file = vimperator.io.getRCFile(); if (rc_file) - vimperator.source(rc_file, true); + vimperator.source(rc_file.path, true); else vimperator.log("No user RC file found", 3); @@ -648,7 +648,7 @@ const vimperator = (function() //{{{ if (plugin_dir) { - var files = vimperator.io.readDirectory(plugin_dir); + var files = vimperator.io.readDirectory(plugin_dir.path); vimperator.log("Sourcing plugin directory...", 3); files.forEach(function(file) { if (!file.isDirectory())