From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14601 invoked by alias); 5 Sep 2015 10:45:26 -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: 36427 Received: (qmail 26884 invoked from network); 5 Sep 2015 10:45:00 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=QyUEpTdO+/0oPrGQITfhYTsB89U=; b=jjNVAE vxLoixnKGtvVlmevfX0EKcpvJxmoiC625cq7pm8eSIN8BVM+w/lh5wGnS27qXXY2 l87lQ/zx8p2Yq3b6DPRrc4pyBsISNVqoB4xX+BYSAwhGxZcJxACa1LEQ13lbgvTL gzZCexjwUR7DSwaRlJN+Av6L3YDj5ndvkXaJY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=QyUEpTdO+/0oPrGQITfhYTsB89U=; b=YECwQ 1UcOkmkIkz+nEJZxnZCG5rKKOwAo10LptheqQM+cWc11n7diHG4CVq7QnaMUk2Om y+sY1DpIPGjPFg5T34R4nBtqoyKKriuGjVrI8PoponiJdtCUmfCoDKDe6aWzXlDg ZqTz+5akxlBmnnVrKDC7/Astmm3cJZf1HF5+yE= X-Sasl-enc: nK6Euvfgs9pdq/Hwd5gKeb70fSGGZbw8amuvsPoKQAfJ 1441449895 Date: Sat, 5 Sep 2015 10:44:49 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: region_highlight cancels styles set in zle_highlight Message-ID: <20150905104449.GB1895@tarsus.local2> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.21 (2010-09-15) How do $zle_highlight and $region_highlight interact? Which one takes precedence if a certain byte range is covered by both? (This came up in [1], which contains observations but no discussion.) Empirically: - if both $zle_highlight[region] and $region_highlight apply to a certain byte range, then that byte range is highlighted according to the former, only: bindkey -v zle_highlight=( region:underline ) f() { region_highlight=("0 10 fg=red") }; zle -N f; bindkey -a ^T f echo foo bar<^T>v0 [the 'echo foo bar' is red but not underlined] - if both $zle_highlight[special] and $region_highlight apply to a certain byte, then both highlightings are applied "on top of" each other: zle_highlight=( special:underline ) f() { region_highlight=("0 10 fg=red") }; zle -N f; bindkey ^T f echo ^T bar «invoke f» [the ^T is red and underlined] How does this work, in general? When does zle merge the settings from the two arrays, and when does one array override the other? Thanks, Daniel (Background: zsh-syntax-highlighting wants the zle_highlight[region] highlighting to be applied "on top of" the syntax highlighting [2]; the workaround [3] works with current zle behaviour of "region_highlight overrides zle_highlight[region]".) [1] http://www.zsh.org/cgi-bin/mla/redirect?WORKERNUMBER=29425 Subject: region_highlight cancels styles set in zle_highlight [2] https://github.com/zsh-users/zsh-syntax-highlighting/issues/165 [3] https://github.com/jimmijj/zsh-syntax-highlighting/commit/ece762e81798bc4448bf17f68a4792d1117dc032