mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-18 22:35:45 +01:00
allow ${VAR} environment variable expansion on Windows too
This commit is contained in:
@@ -426,12 +426,12 @@ function IO() //{{{
|
|||||||
}
|
}
|
||||||
|
|
||||||
// expand any $ENV vars - this is naive but so is Vim and we like to be compatible
|
// 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
|
// TODO: Vim does not expand variables set to an empty string (and documents it).
|
||||||
// ${VAR} on WINDOWS - are we just matching bugs?
|
// Kris reckons we shouldn't replicate this 'bug'. --djk
|
||||||
// Yes. --Kris
|
// TODO: should we be doing this for all paths?
|
||||||
path = path.replace(
|
path = path.replace(
|
||||||
WINDOWS ? /\$(\w+)\b|%(\w+)%/g : /\$(\w+)\b|\${(\w+)}/g,
|
RegExp("\\$(\\w+)\\b|\\${(\\w+)}" + (WINDOWS ? "|%(\\w+)%" : ""), "g"),
|
||||||
function (m, n1, n2, i, s) environmentService.get((n1 || n2), "$1")
|
function (m, n1, n2, n3) environmentService.get(n1 || n2 || n3) || m
|
||||||
);
|
);
|
||||||
|
|
||||||
return path.replace("\\ ", " ", "g");
|
return path.replace("\\ ", " ", "g");
|
||||||
|
|||||||
@@ -147,6 +147,13 @@ The same as [c]:set[c] command, but operates on global options only.
|
|||||||
See [c]:set[c] for details.
|
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]
|
section:Setting{nbsp}Firefox{nbsp}options[firefox-options]
|
||||||
|
|
||||||
Most Firefox options are not touched/overridden by Vimperator. In order to set
|
Most Firefox options are not touched/overridden by Vimperator. In order to set
|
||||||
|
|||||||
Reference in New Issue
Block a user