From 34d69acbef44f654ea51d762ffdb02f5b1e8b9e1 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Wed, 29 Apr 2020 00:30:17 +0000 Subject: 45737 (+ docs, and update the test from 45722): zstyle: When determining the weight (specificity) of a pattern, consider the number of components before anything else, as documented. --- Doc/Zsh/mod_zutil.yo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Doc') diff --git a/Doc/Zsh/mod_zutil.yo b/Doc/Zsh/mod_zutil.yo index c69233f9d..9c50e6122 100644 --- a/Doc/Zsh/mod_zutil.yo +++ b/Doc/Zsh/mod_zutil.yo @@ -40,8 +40,8 @@ that it looks up the tt(preferred-precipitation) style under the `tt(:weather:)var(continent)tt(:)var(day-of-the-week)tt(:)var(phase-of-the-moon))' context. According to this, you might set the following in your tt(zshrc): -example(zstyle ':weather:*:Sunday:*' preferred-precipitation snow -zstyle ':weather:europe:*' preferred-precipitation rain) +example(zstyle ':weather:europe:*' preferred-precipitation rain +zstyle ':weather:*:Sunday:*' preferred-precipitation snow) Then the plugin would run under the hood a command such as @@ -52,7 +52,7 @@ On Sundays tt($REPLY) would be set to `tt(snow)'; in Europe it would be set to `tt(rain)'; and on Sundays in Europe it would be set to `tt(snow)' again, because the patterns `tt(:weather:europe:*)' and `tt(:weather:*:Sunday:*)' both match the var(context) argument to tt(zstyle -s), are equally specific, and the -latter was defined first. +latter is more specific (because it has more colon-separated components). em(Usage) -- cgit 1.4.1