From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5864 invoked by alias); 13 Jul 2016 10:21:04 -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: 38845 Received: (qmail 3124 invoked from network); 13 Jul 2016 10:21:04 -0000 X-Qmail-Scanner-Diagnostics: from nm27-vm7.bullet.mail.ir2.yahoo.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(212.82.97.58):SA:0(0.0/5.0):. Processed in 0.195036 secs); 13 Jul 2016 10:21:04 -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=FREEMAIL_FROM,SPF_PASS, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: okiddle@yahoo.co.uk X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _spf.mail.yahoo.com designates 212.82.97.58 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1468404827; bh=fnZD0Ll7+oeU/bxfkLae5b3tkq5fjyz3Apjb+f8zsrQ=; h=In-reply-to:From:References:To:Subject:Date:From:Subject; b=K0y03eVjvfhUsDFSoi2ahub7bpZ22KcLve4zjBDafehvLydhQAjyVmGgfwrCDCcOuWQiUZ/k8vvFR8yCquOLomwGgM5BVdTpI2MIzwodOIrcuv+83gPbNbRpgbr+10Nph2K3GPlxqwPp4N+BEl/pv3z2y8z2fYTx5gbhFZkjuQsLmqsfHnJFMs2p3x3HWcYNvLBwXbzWd4tyyeMvNK1zV4gh7bJ3OL7QByA2SOSXPNWCwHyB2rXfr/wYoCeDnG+0LOLNTD/qP5/q5btcOl/qq4auBkZVWbzE5pCyFrBH3up0QlEdSHSqJ/s953Lgb8/sGJHrmCtwOSNsUFPAsO7AiQ== X-Yahoo-Newman-Id: 157850.60899.bm@smtp128.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: AZzsEX8VM1mMJqxbvzGhHWNFjz1HAwPKYOm_yWvwj382ktR SedzZeEZyIWMRaa7qc7xM6iVR9TOraLQu1YZO8fOfucPKqksyfFrhrIM9HeH MWHcJPdG27sJ8p_M_aFXbqLSxFpKXKZu7aQIMFzsXVXRubOss34f22NXWl6S kMRam.YcpwypRtLylUlt0Aoe9YQ0UzKVeIY8i2PsifmB2ENzs86ax9SWXgM. Tb1g2Qby00wXNPPd1ZEpCTjxmgm6kiDimE6p7gdblhdF7omdNsLPVhRSyBa0 Xpq6kX_8Fhk3gci5LJEdRxX0hFJCubuw66VBtr2qfcJo2Aav5fbTOc_n0cqk uLEDijLbBuFOWf0rO0nW2A_Ip8k1v6nlvu47W.a0JP.hZCv7D5jQu3EHQOAK fSpURd1xVeC6OvLvKv7UD.4tsFQhkqN7htopkJS0ngUWNDGDD.wUFFEJO4r8 FvT5elphH4CnCBLVq9gPJF3eBylCkzNwipptniqPZGU8Pm2yPp9ZO4t5oJE2 1mds4RiPfagj3jszX3zAON1OALz29cF.8PzQDEpmnTXo- X-Yahoo-SMTP: opAkk_CswBAce_kJ3nIPlH80cJI- In-reply-to: <160711212814.ZM15416@torch.brasslantern.com> From: Oliver Kiddle References: <160711212814.ZM15416@torch.brasslantern.com> To: zsh-workers@zsh.org Subject: Re: State of the ZLE region across new prompts MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <53282.1468404826.1@hydra.kiddle.eu> Date: Wed, 13 Jul 2016 12:13:46 +0200 Message-ID: <53283.1468404826@hydra.kiddle.eu> Bart wrote: > With this in place, run a command, then when ZLE resumes at the next > prompt, start recalling commands with up-line-or-history. Note that > they are highlighted. I'm not entirely sure but I believe this means > the region is still active, not just that highlighting is confused. > Is REGION_ACTIVE intended to persist in this way? Yes, the region is remaining active. We reset it before calling zle-line-finish. The patch below instead resets it on entry, before zle-line-init. > Aside: The documentation for the zle_highlight "region" context > discusses "calling set-mark-command with a negative numeric argument" > and "exchange-point-and-mark with a zero numeric argument" but does > not mention deactivate-region or assignments to REGION_ACTIVE. How about the following rewording? I don't think it is the right place in the documentation to enumerate all the ways in which the region can be activated and deactivated so this removes the part about numeric arguments (which is covered under the respective widgets documentation). "selection" is probably the most common term for what emacs calls the region and vim's visual mode warrants a mention. Oliver diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo index f51eada..1642c5b 100644 --- a/Doc/Zsh/zle.yo +++ b/Doc/Zsh/zle.yo @@ -2571,15 +2571,14 @@ When one of the incremental history search widgets is active, the area of the command line matched by the search string or pattern. ) item(tt(region))( -The region between the cursor (point) and the mark as set with -tt(set-mark-command). The region is only highlighted if it is active, -which is the case if tt(set-mark-command) or tt(exchange-point-and-mark) -has been called and the line has not been subsequently modified. The -region can be deactivated by calling tt(set-mark-command) with a -negative numeric argument, or reactivated by calling -tt(exchange-point-and-mark) with a zero numeric argument. Note -that whether or not the region is active has no effect on its -use within widgets, it simply determines whether it is highlighted. +The currently selected text. In emacs terminology, this is referred to as +the region and is bounded by the cursor (point) and the mark. The region +is only highlighted if it is active, which is the case after the mark +is modified with tt(set-mark-command) or tt(exchange-point-and-mark). +Note that whether or not the region is active has no effect on its +use within emacs style widgets, it simply determines whether it is +highlighted. In vi mode, the region corresponds to selected text in +visual mode. ) cindex(special characters, highlighting) cindex(highlighting, special characters) diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 472e326..ac31d4e 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.c @@ -1159,7 +1159,6 @@ zlecore(void) } - region_active = 0; popheap(); } @@ -1292,6 +1291,7 @@ zleread(char **lp, char **rp, int flags, int context, char *init, char *finish) lastcol = -1; initmodifier(&zmod); prefixflag = 0; + region_active = 0; zrefresh();