From 706f2d0c93a55ffbf131000f0fcb1d8dc5cac242 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Sun, 20 Jul 2008 13:06:01 +0000 Subject: [PATCH] add new 'urlseparator' option --- NEWS | 2 ++ content/util.js | 2 +- content/vimperator.js | 4 ++++ locale/en-US/browsing.txt | 4 ++-- locale/en-US/options.txt | 11 +++++++++++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 18ae9c3f..fce21f2b 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ generous donation which made this behavior possible) * IMPORTANT: ctrl-x/a never take possible negative URLs into account, it was just too unpredictable + * new 'urlseparator' option for specifying the regexp used to split the arg to + :open, :tabopen and :winopen * :set editor now accepts quoting/escaping to use an editor with spaces in the path * support for :%foo as a count for commands (not yet widely used) * show informative message when a background tab was loaded, especially useful diff --git a/content/util.js b/content/util.js index b3b3cd19..1abb3d2f 100644 --- a/content/util.js +++ b/content/util.js @@ -278,7 +278,7 @@ liberator.util = { //{{{ // and returns an array ['www.google.com/search?q=bla', 'www.osnews.com'] stringToURLArray: function (str) { - var urls = str.split(/\s*\,\s+/); + var urls = str.split(new RegExp("\s*" + liberator.options["urlseparator"] + "\s*")); begin: for (var url = 0; url < urls.length; url++) { diff --git a/content/vimperator.js b/content/vimperator.js index 5b85e033..cfcb9457 100644 --- a/content/vimperator.js +++ b/content/vimperator.js @@ -375,6 +375,10 @@ liberator.config = { //{{{ getService(Components.interfaces.nsIIOService2).offline; } }); + + liberator.options.add(["urlseparator"], + "Set the separator regexp used to split URL args", + "string", ",\\s"); } //}}} }; //}}} diff --git a/locale/en-US/browsing.txt b/locale/en-US/browsing.txt index ae946799..13b644e7 100644 --- a/locale/en-US/browsing.txt +++ b/locale/en-US/browsing.txt @@ -35,8 +35,8 @@ section:Opening{nbsp}web{nbsp}pages[opening] ||o|| ________________________________________________________________________________ Open one or more URLs in the current tab. -Multiple URLs can be separated with ", ". -Note that the space after the comma is required. +Multiple URLs can be separated with 'urlseparator' (default: ", " Note that the +space after the comma is required.") Each token is analyzed and in this order: 1. Opened as a local file if it is an existing relative or absolute filename. diff --git a/locale/en-US/options.txt b/locale/en-US/options.txt index 00275e87..126e5cc3 100644 --- a/locale/en-US/options.txt +++ b/locale/en-US/options.txt @@ -565,6 +565,17 @@ Note that this is a local option for now, later it may be split into a global an ____ +|\'urlseparator'| +||'urlseparator'|| string (default: ",\s") +____ +Set the separator regexp used to separate multiple URL args. Multiple +arguments can be specified for :open, and similar commands, using this regexp +as the separator. Using whitespace alone is not generally useful since it is +often contained in a single argument. E.g. [c]:open linus torvalds[c] should +perform a single search for the key words "linus" and "torvalds" +____ + + |\'verbose', \'vbs'| ||'verbose' 'vbs'|| number (default: 0) ____