From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28489 invoked by alias); 12 Sep 2015 00:17:15 -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: 36501 Received: (qmail 23146 invoked from network); 12 Sep 2015 00:17:14 -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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tfW06s16AwlId6CzDJOgNyn8A7aY0dHf8cjz7lnY5NU=; b=RMGfG1lnXd1cgPL9cqYC3HZ/4SB4DxJtJaXOba0MNCp7mmnOql2PC8q5zNdEgEIwjt CloSipH247K7/bWOvsqiZvk31DpnDhUeZ5eSQ1MkMg39GqAjUfmIPHgToR3JBMZH6cNS iKryPOcfUU3cUTlmcrnc9PHgaP/GzKi8cYXw991wu+ZJhQFcd4tAKaxfNAY/hpVPmiAc BkjGIhebf0neN0wgmtMbdUYTW2cd1QpFHMgBdwKtdSBJyiwQ4XY7UU6vdia2s4Q6/x8v LSVtpzKUiIxOlBfUnaLjOwM3TFb0M35EHhOCwkpTMCsAX6pzwWLpQgYkuodAOC2hOkHK VUgw== MIME-Version: 1.0 X-Received: by 10.140.109.54 with SMTP id k51mr2524271qgf.77.1442017030768; Fri, 11 Sep 2015 17:17:10 -0700 (PDT) In-Reply-To: <150911160702.ZM8647@torch.brasslantern.com> References: <20150829012452.GE30848@bosko.stateful.de> <150828220057.ZM14497@torch.brasslantern.com> <20150830202530.GF30848@bosko.stateful.de> <150901164827.ZM2480@torch.brasslantern.com> <20150903235936.GH30848@bosko.stateful.de> <20150906095224.GD1895@tarsus.local2> <4397.1441547465@thecus.kiddle.eu> <13644.1441708777@thecus.kiddle.eu> <20150910191143.GG10129@tarsus.local2> <150911160702.ZM8647@torch.brasslantern.com> Date: Sat, 12 Sep 2015 02:17:10 +0200 Message-ID: Subject: Re: bracketed paste - chopping trailing newlines From: Mikael Magnusson To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset=UTF-8 On Sat, Sep 12, 2015 at 1:07 AM, Bart Schaefer wrote: > On Sep 10, 7:11pm, Daniel Shahaf wrote: > } > } Yes, I also feel I'm repeating myself. I've already made my case a few > } times. I've also suggested fixes and implemented them. I have been > } trying to reach consensus, but so far haven't succeeded. As you can > } imagine, by now I'm rather frustrated. > > This may be a situation where it's not possible to get consensus. We > have I think three different approaches (Oliver's, Carsten's, yours) > none of the three agrees with either of the others, and we haven't > tried conducting any sort of poll. If three developers on the mailing list can't agree, chances are at least one user will be unhappy with whatever we decide. > } 1. Don't strip newlines at paste > } 2. Highlight pastes > } 3. Strip newlines at accept-line that immediately follows a paste > } > } I think all objections to (2) have been addressed, apart from the > } question of whether to use standout or underline. I think standout is > } easier to spot and doesn't clash with zle_highlight[region]'s default > > I'm of two minds here. One, there is a relationship between paste and > the region -- if the region is active, the paste replaces it. However, > if there is no active region, the paste does not make it active (even > though it sets MARK/CURSOR to the opposite ends and e.g. kill-region > will kill the pasted text). So two, making the paste look the same as > an active region may be misleading ... or, maybe it's OK because it's > almost the same thing. I personally find it very surprising that pasting would interact with the region in any way at all, yanking normally doesn't. If this is some special vi thing, maybe it should only be replaced in vi mode. I don't think the region and pasted text have anything in common or are "almost the same thing", and I don't think they should be, unless we also make yanked text act the same way, which I also don't think we should. (My interest here is mostly academic since I won't use any of this builtin behavior. I would personally prefer if nothing gets deleted, nothing gets stripped, and generally nothing in general happens except the text gets pasted, like I asked it to be. I don't think anyone ever complained to me about the behavior of the widget I made, but then again, they all added it on purpose). > I guess I agree with Oliver about the newline stripping. We have at least two options that decide if and how we print a single newline before drawing the prompt, maybe there is room for some here as well. -- Mikael Magnusson