Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm
Precedence: bulk
X-No-Archive: yes
List-Id: Zsh Workers List <zsh-workers.zsh.org>
List-Post: <mailto:zsh-workers@zsh.org>
List-Help: <mailto:zsh-workers-help@zsh.org>
X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.com by f.primenet.com.au (envelope-from <p.stephenson@samsung.com>, uid 7791) with qmail-scanner-2.11 
 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1.  
 Clear:RC:0(210.118.77.11):SA:0(-1.3/5.0):. 
 Processed in 0.145482 secs); 12 Jul 2016 08:28:25 -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=-1.3 required=5.0 tests=RP_MATCHES_RCVD
	autolearn=unavailable autolearn_force=no version=3.4.1
X-Envelope-From: p.stephenson@samsung.com
X-Qmail-Scanner-Mime-Attachments: |
X-Qmail-Scanner-Zip-Files: |
Received-SPF: none (ns1.primenet.com.au: domain at samsung.com does not designate permitted sender hosts)
X-AuditID: cbfec7f4-f796c6d000001486-b9-5784aa2296fb
Date: Tue, 12 Jul 2016 09:28:16 +0100
From: Peter Stephenson <p.stephenson@samsung.com>
To: zsh-workers@zsh.org
Subject: Re: State of the ZLE region across new prompts
Message-id: <20160712092816.6abe0c53@pwslap01u.europe.root.pri>
In-reply-to: <160711212814.ZM15416@torch.brasslantern.com>
References: <160711212814.ZM15416@torch.brasslantern.com>
Organization: Samsung Cambridge Solution Centre
X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu)
MIME-version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7bit
X-Brightmail-Tracker:
 H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xa7pKq1rCDTZO5rE42PyQyYHRY9XB
	D0wBjFFcNimpOZllqUX6dglcGZdP32UruMlecfnxYaYGxk62LkZODgkBE4np8y+wQNhiEhfu
	rQeKc3EICSxllFhzfhMrhDODSWLVj7ksEM45RomdSyYwgrQICZxllPi+vxTEZhFQlbiw9zLY
	KDYBQ4mpm2aD1YgIiEucXXseLC4sYC7x6MU/9i5GDg5eAXuJIzfBruAUsJL4OPcMO8RIS4mZ
	B2aC2fwC+hJX/35igrjOXmLmlTNgI3kFBCV+TL4HNpJZQEti87YmVghbXmLzmrfMEHPUJW7c
	3c0+gVF4FpKWWUhaZiFpWcDIvIpRNLU0uaA4KT3XUK84Mbe4NC9dLzk/dxMjJJi/7GBcfMzq
	EKMAB6MSD++D083hQqyJZcWVuYcYJTiYlUR4Hy5vCRfiTUmsrEotyo8vKs1JLT7EKM3BoiTO
	O3fX+xAhgfTEktTs1NSC1CKYLBMHp1QD41qF5rrlsYudPz5msGvyP9E9aYfPtHAVvrenDePS
	3t5oebhw2tnpwSqrik1eTOqcVB9tqcl20svkIsekl1eTTk9J+zTx/jGxxU/v5rzoqZlVtCTr
	YV4k98t4iSunhRc51Rj/0LBl7s7n4qjYr+Idz9j+3WTWifcfTl+eXaVad//x3HNhtxw1KpRY
	ijMSDbWYi4oTAX0wSoliAgAA
X-Seq: zsh-workers 38836

On Mon, 11 Jul 2016 21:28:14 -0700
Bart Schaefer <schaefer@brasslantern.com> wrote:
> Consider:
> 
>     zle-line-finish() { CURSOR=0 MARK=$#BUFFER REGION_ACTIVE=1 }
>     zle -N zle-line-finish
> 
> The idea here, such as it is, is to highlight the entire buffer before
> it is executed.  (I was doing this to test something unrelated.)
> 
> 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?

I think the problem is that region_active is set to 0 at the end of
zlecore(), so you're missing it when zle-line-finish is called.  This is
therefore an edge case.

It's presumably reasonable also to set it to 0 on any entry to the
top-level of ZLE at the start of zleread(). 

pws

