From 7e5ee56443e7f4da0f52887edbc7d5e9a54a35d4 Mon Sep 17 00:00:00 2001 From: Bart Schaefer Date: Mon, 1 May 2000 18:14:08 +0000 Subject: don't fail on nonexistent ~/.nedit file. --- Completion/Core/_expand | 7 ++++--- Completion/User/_nedit | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'Completion') diff --git a/Completion/Core/_expand b/Completion/Core/_expand index 1a96e654e..293ad3649 100644 --- a/Completion/Core/_expand +++ b/Completion/Core/_expand @@ -32,13 +32,14 @@ fi exp=("$word") # First try substitution. That weird thing spanning multiple lines -# changes quoted spaces, tabs, and newlines into spaces. +# changes quoted spaces, tabs, and newlines into spaces and protects +# this function from aborting on parse errors in the expansion. { zstyle -s ":completion:${curcontext}:" substitute expr || { [[ "$curcontext" = expand-word:* ]] && expr=1 } } && [[ "${(e):-\$[$expr]}" -eq 1 ]] && - exp=( "${(e)exp//\\[ -]/ }" ) + exp=( ${(f)"$(print -lR - ${(e)exp//\\[ +]/ } 2>/dev/null)"} ) # If the array is empty, store the original string again. diff --git a/Completion/User/_nedit b/Completion/User/_nedit index a3fcd9785..5261a54a9 100644 --- a/Completion/User/_nedit +++ b/Completion/User/_nedit @@ -44,7 +44,7 @@ else "$nedit_common[@]" fi -[[ $state = lang ]] && +[[ $state = lang && -f ~/.nedit ]] && _wanted neditlanguages expl 'language mode' \ compadd - ${(f)"$(sed -n \ '/^nedit.languageMode/,/^nedit/ s/.* \([^:]*\).*/\1/p' < ~/.nedit)"} -- cgit 1.4.1