Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] _subversion: Don't cache an empty commands list when svn is not available at the first invocation of _svn.
- X-seq: zsh-workers 41458
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] _subversion: Don't cache an empty commands list when svn is not available at the first invocation of _svn.
- Date: Tue, 25 Jul 2017 14:11:49 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=q3o0wW XAygPCdu/ZRbLWM1pqb0exteNVu1bAkQN24mg=; b=mI9rzB/BlkRwNiyhd953l9 X2nVwhPCZ8SYnaWUanunJyq1zDtQWHqhmElSW3LrEr9IGkq94LlPNg6jeTLlvwXw P1L5NlkyiwxMnRcdTDTZYJFZ+DjOf3hluaACw5XeyDqmz0kvn4q8VfLPXlD5Vp3A /MUjABrETPPCLIbg5p6Tch6nC/BF0SHX/1jwD3nxHa3ZZ8P2mb1WvO+xyd2F1z8i /a4UR291OdoWOJAXhfzSFQw2EC3uauJrMXU2SXeQ0DiI59ojrslisjLWEekP0olO mHQK5rM6ZNfAyxfaLXqNQBkw0JimsQ0uknEVMOvOesJEFbZEJers8U2Q3e6nk5oA ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=date:from:message-id:subject:to :x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=q3o0wW XAygPCdu/ZRbLWM1pqb0exteNVu1bAkQN24mg=; b=nwuyNnxH9y+vJSM+v4fYiT abHMpQnFOZ8wM45Zaea/kaYKbznoX+N0OSAdZn/IUhmY2cWT3qQWhvkSS7zW/zcp AMsU95CqyB1D6OEr2gB/1EXnmjUJswZOB4F7boWQ3t80dAk8kH6KgYB+r+4zctkG /E46gPWrvUjT99cBq+DlOlpy/YDvGdRswUr/WTxPIJ1U0xONk2r04QQMTG41NFpd nL2jx9CkPT5GjaomIcFQiZhdZbCr6zPnCH/Bkst6mvU6EEoH2iR0q1YweX6ydOni 4le6r6gCoKfjWtRHtenl787fHgni4GBzH7oRq1Qv3t+8pt5zBswildn1BVBMRaXg ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
---
This affects the following use-case:
% svn <TAB><prints "No matches">^C
% ${PACKAGEMANAGER} install subversion
% svn <TAB>
Before the patch it would cache the "No matches", with the patch it invokes svn
again.
Cheers,
Daniel
Completion/Unix/Command/_subversion | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Completion/Unix/Command/_subversion b/Completion/Unix/Command/_subversion
index 640c88950..2f6b567ac 100644
--- a/Completion/Unix/Command/_subversion
+++ b/Completion/Unix/Command/_subversion
@@ -36,7 +36,12 @@ _svn () {
_svn_cmds=(
${=${(f)${${"$(_comp_locale; _call_program commands svn help)"#l#*Available subcommands:}%%Subversion is a tool*}}/(#s)[[:space:]]#(#b)([a-z]##)[[:space:]]#(\([a-z, ?]##\))#/$match[1] :$match[1]${match[2]:+:${${match[2]//[(),]}// /:}}:}
)
- _store_cache svn-cmds _svn_cmds
+ if (( $? == 0 )); then
+ _store_cache svn-cmds _svn_cmds
+ else
+ # Ensure we enter this block again on the next <TAB>.
+ unset _svn_cmds
+ fi
fi
fi
Messages sorted by:
Reverse Date,
Date,
Thread,
Author