1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 00:17:57 +01:00

* merged ctrl-x/a commands

* fixes for file:/ handling
* fixed gu and gU
This commit is contained in:
Martin Stubenschrott
2007-11-22 20:00:46 +00:00
parent a09691d658
commit 794e80c1a8
6 changed files with 91 additions and 40 deletions

View File

@@ -98,21 +98,19 @@ vimperator.util = { //{{{
begin: for (var url = 0; url < urls.length; url++)
{
var newURL = vimperator.buffer.URL;
var matches;
// strip each 'URL' - makes things simpler later on
urls[url] = urls[url].replace(/^\s+/, "").replace(/\s+$/, "");
// first check if it is an existing local file
var file = vimperator.io.getFile(urls[url]);
if (file.exists())
if (file.exists() && file.isReadable())
{
urls[url] = file.path;
continue;
}
// Disabled for now, use gu and GU or O and change the last part
// var newURL = vimperator.buffer.URL;
// // FIXME: not really that good (doesn't handle .. in the middle)
// // check for ./ and ../ (or even .../) to go to a file in the upper directory
// if (matches = urls[url].match(/^(?:\.$|\.\/(\S*))/))
@@ -138,6 +136,7 @@ vimperator.util = { //{{{
// if the string doesn't look like a valid URL (i.e. contains a space
// or does not contain any of: .:/) try opening it with a search engine
// or keyword bookmark
var matches;
if (/\s/.test(urls[url]) || !/[.:\/]/.test(urls[url]))
{
matches = urls[url].match(/^(\S+)(?:\s+(.+))?$/);