diff --git a/content/io.js b/content/io.js index c61e42a9..9ff46105 100644 --- a/content/io.js +++ b/content/io.js @@ -426,12 +426,12 @@ function IO() //{{{ } // expand any $ENV vars - this is naive but so is Vim and we like to be compatible - // TODO: Vim does not expand variables set to an empty string, nor does it recognise - // ${VAR} on WINDOWS - are we just matching bugs? - // Yes. --Kris + // TODO: Vim does not expand variables set to an empty string (and documents it). + // Kris reckons we shouldn't replicate this 'bug'. --djk + // TODO: should we be doing this for all paths? path = path.replace( - WINDOWS ? /\$(\w+)\b|%(\w+)%/g : /\$(\w+)\b|\${(\w+)}/g, - function (m, n1, n2, i, s) environmentService.get((n1 || n2), "$1") + RegExp("\\$(\\w+)\\b|\\${(\\w+)}" + (WINDOWS ? "|%(\\w+)%" : ""), "g"), + function (m, n1, n2, n3) environmentService.get(n1 || n2 || n3) || m ); return path.replace("\\ ", " ", "g"); diff --git a/locale/en-US/options.txt b/locale/en-US/options.txt index fc137f2f..55aee76c 100644 --- a/locale/en-US/options.txt +++ b/locale/en-US/options.txt @@ -147,6 +147,13 @@ The same as [c]:set[c] command, but operates on global options only. See [c]:set[c] for details. ____ + +|expand-environment-var| |expand-env| |:set_env| + + +Environment variables are expanded for path options like 'cdpath' and +'runtimepath'. The variable notation is _$VAR_ (terminated by a non-word +character) or _$\\{VAR}_. _%VAR%_ is also supported on Windows. + section:Setting{nbsp}Firefox{nbsp}options[firefox-options] Most Firefox options are not touched/overridden by Vimperator. In order to set