From 20553e823491d42bc3f0cf84928a752858d60de5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 6 Aug 2014 12:35:11 +0530 Subject: [PATCH] zsh completion: Case independent extension matching --- src/calibre/linux.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/calibre/linux.py b/src/calibre/linux.py index 6f70f50aeb..84ebd1db7d 100644 --- a/src/calibre/linux.py +++ b/src/calibre/linux.py @@ -239,9 +239,8 @@ class ZshCompleter(object): # {{{ opf_opts=('--opf',), file_map={}): if not self.dest: return - exts = set(exts).union(x.upper() for x in exts) - pats = ('*.%s'%x for x in exts) - extra = ("'*:filename:_files -g \"%s\"' "%' '.join(pats),) + exts = sorted(set(exts)) + extra = (''''*:filename:_files -g '(#i)*.(%s)' ''' % '|'.join(exts),) opts = '\\\n '.join(tuple(self.get_options( op(), cover_opts=cover_opts, opf_opts=opf_opts, file_map=file_map)) + extra) txt = '_arguments -s \\\n ' + opts