From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 822819e2 for ; Sun, 9 Dec 2018 19:01:09 +0000 (UTC) Received: (qmail 3220 invoked by alias); 9 Dec 2018 19:00:53 -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: List-Unsubscribe: X-Seq: 43876 Received: (qmail 7250 invoked by uid 1010); 9 Dec 2018 19:00:53 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-9.server.virginmedia.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(80.0.253.73):SA:0(-2.0/5.0):. Processed in 5.378334 secs); 09 Dec 2018 19:00:53 -0000 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Originating-IP: [86.16.88.158] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=A/5CwZeG c=1 sm=1 tr=0 a=MiHCjVqLJ44lE3bxSlffFQ==:117 a=MiHCjVqLJ44lE3bxSlffFQ==:17 a=IkcTkHD0fZMA:10 a=-wyNZNy3d2qcKJLX6kAA:9 a=QEXdDO2ut3YA:10 a=pHzHmUro8NiASowvMSCR:22 a=6VlIyEUom7LUIeUMNQJH:22 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1544381345; bh=ELvILWKAH27hJ7I8KG0c+kLuAUl//7oDd6EgzlkwJlc=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=mpbmn3SA+GD1/f37ncb+dyVQRvVQYPC+2oZIKOHS2G1sfJzEI9pPtEYAu4vvJGXU9 E3A3h4d52AT8RcyTx10HRfsre19RXZHTh2TeHEPrmd1l6vcDCou8iOsL5r964QOX/6 nZHNdIsPJaSXCeLvyYIYjNBDqHRpJd8yCANMv70mKcfWGk7zfxPH1HTAL6qjrsEZXE lG/f2GrpBv7E0t5RkfayaM2NQFGv+7PJrd07k5f9wjkwkTXLtJjrNcxw+MrWvshhX4 +2ysZBscGH2wZrVMJnSjujfpcXhv7OSzvQ5L2p2dZkDth0xtbX5YJPAHXnZ2U8KmEe nTGA9wvQNe1nA== Message-ID: <53005dd0750e99fb654f5708a6e256dbea6f899a.camel@ntlworld.com> Subject: Re: [BUG] region_highlight+=( "$start $end standout" ) doesn't work as expected From: Peter Stephenson To: Sebastian Gniazdowski , Daniel Shahaf Cc: Zsh hackers list Date: Sun, 09 Dec 2018 18:49:03 +0000 In-Reply-To: References: <1544168721.2479259.1601798392.35689542@webmail.messagingengine.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfNAKnCgQaOSfXoLgwQgjvaLUKN4+6OD5eataglDP0F9Mzb+LNeqMfcyesKwRwBg7PSCdFPYddnQ4s/vKboTOPyOPL7/8NYUZAhlz5aXwQSEmEVjvTp+4 LSuJmPD2f38gGrIzHzF2o9HTyf7tbI5wX71PTuxUISPNySdCQLwCoZD5a73uFxyk2neVQ0CchiwpgcyuMRv+yz/yuKkiby+ocEkr+WhpMqpnA4RGFXfrp/Pj EE/zAFGpqfccgFUUXNd55Q== > Could the problem be fixed, .. ASAP? I won't be working on this, but I can give some poiners. You'll need to look in Src/Zle/zle_refresh.c. You'll see the region_highlights variable that contains the information. There are 4 special regions at the start --- see definition of N_SPECIAL_HIGHLIGHTS. There are two key points in turning this information into the output. One is following the comment "Calculate attribute based on region". That's where the information gets encoded into the array of characters to output, which remembers the attributes associated with the character based on the last thing to change. The other is inside settextattributes(), where the appropriate sequences are output. That's called at various points during the output, but only if we detect something has changed in them: zwcputc() is the key location, but you'll see there are others. The big issue here is that the shell is turning structured information into a sequence to output --- it's not outputing a character with particular attributes at a particular location, it's outputing a stream consisting of a mix of characters and instructions to change attributes. So, for example, if two changes logically occur at the some point which one actually happens is, while supposedly well-defined (can't remember the rules but I think they're documented, not necessarily in full detail), is bug-prone. If you're problem has got to do with line wrap, that's even worse --- as widely noted in earlier threads, you're then fighting various terminals and their definitions, too. Good luck. pws