From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6669 invoked by alias); 21 Oct 2016 05:57:27 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 39696 Received: (qmail 11320 invoked from network); 21 Oct 2016 05:57:27 -0000 X-Qmail-Scanner-Diagnostics: from mail-vk0-f54.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.213.54):SA:0(0.0/5.0):. Processed in 0.774067 secs); 21 Oct 2016 05:57:27 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject:cc :mime-version; bh=X2Jywoc2Kbo02iFcPjy2zsqgrF9URO/TXE/fYzTGka8=; b=j3u5MppMLIpEabnnFoEEd2aKSp3PijKanWwfDjnjVGRjPZFKgt2emVXFC+iP//hSn1 pDKLr2CFad1BPA8IZP5IbcppQiDGQEkGn87F0ruOQ7D4TelGM1maQAAdAl9fx9hRtcZC BwbpuZrfuwW3K6OSrU3zkHwGbJqy9PtH+LlvPZ5g8QWC+k7kBcZRSdM+EguqtFoMQcBg QkNmFYxZJbMy2KQxYra4aUOxrrz8dGbTvEjdG2/OwVIuYfDwmHdoStH/6n6AFCKp2zOF IycPpSgANNIpZsZYtCKnZfds2HE9ImXboJ6aUNO++xBwz0Fx5LIOmPG4oHRoPXnVdaw6 hG5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:cc:mime-version; bh=X2Jywoc2Kbo02iFcPjy2zsqgrF9URO/TXE/fYzTGka8=; b=jxwwH9jNSfXEsNzMDANYOkGDvI+5K4zbcB694qh/xDsRVc4PtXk8wDeUCgz4QDN/2Z XPwRU0YVTj/hcrYeHJJg8yQJEZrJj1pCj3Y/viI8/3fcVSLwQswAko3NN0fNO0Pzgkj1 t2TgzrLxAx+GxY4nK2ZyLwZta0NQzGyzngRhMur+iTY+K4xXulaUUle28X7OX/81Goeo laTdafsBf72+QFwEpOvrDmom3lw92hhlAHhEdWEr24k2XQcMhNPC7Ne7elyRtWh1DzIE w7tr1DTOz5dgRxqv/Uhg7G+XGzYhOPF3pXa3uf+UGpbWlIDNskFbUUGeDFrvHcbK/zbT l6rg== X-Gm-Message-State: AA6/9RnuUVd6CsCWsGWAwDAfTU/hMfsxPOm6GfK7hNl342lnexnrmgQ6QCL63JSEuzvBkg== X-Received: by 10.31.236.69 with SMTP id k66mr5410473vkh.83.1477022854380; Thu, 20 Oct 2016 21:07:34 -0700 (PDT) From: Bart Schaefer Message-Id: <161020210735.ZM6446@torch.brasslantern.com> Date: Thu, 20 Oct 2016 21:07:35 -0700 In-Reply-To: Comments: In reply to Danielle McLean "zsh/complist colours improperly handle multibyte characters" (Oct 21, 12:09pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: zsh/complist colours improperly handle multibyte characters Cc: danielsh@apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Oct 21, 12:09pm, Danielle McLean wrote: } } Presumably, zsh/complist's pattern parsing is only aware of one- and } two-byte chars, and its (#b)-based grouping mistakenly assumes that } all characters are single bytes. Reaching this conclusion might be understandable, but it is pretty far off the mark. The problem with the (#b) example is not that the pattern has matched improperly, but that #ifdef MULTIBYTE_SUPPORT has never been worked into complist.c:clprintfmt(). So it is counting the bytes rather than the display width when deciding where to start/stop coloring. I'm not going to dive into that, I don't know the multibyte handling code well enough. The problem with the vertical-bar example is that the pattern did not compile correctly at all. The same effect occurs if you use "#" in that position -- it results in an invalid pattern which is silently ignored. Stepping through with gdb for the vertical-bar pattern, I get: pattern.c:1530: BUG: - missing from numeric glob I thought this was a metafication problem, and indeed if I metafy() the string passed to patcompile() then the compilation succeeds, but then the resulting program fails to match for even simple patterns so nothing is ever colored. This is about as far as I'm going to be able to get with this.