zsh-workers
 help / color / mirror / code / Atom feed
From: Mikael Magnusson <mikachu@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: bracketed paste - chopping trailing newlines
Date: Sat, 12 Sep 2015 02:17:10 +0200	[thread overview]
Message-ID: <CAHYJk3RJg+1kSM6pq1ZirbwEjn0tZKV0pYdnTb8cPO5fC+wKtg@mail.gmail.com> (raw)
In-Reply-To: <150911160702.ZM8647@torch.brasslantern.com>

On Sat, Sep 12, 2015 at 1:07 AM, Bart Schaefer
<schaefer@brasslantern.com> 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


  reply	other threads:[~2015-09-12  0:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-29  1:24 Carsten Hey
2015-08-29  5:00 ` Bart Schaefer
2015-08-30 20:25   ` Carsten Hey
2015-08-30 20:32     ` [patch] 5.0.9 vs 5.1 in source code comments (was: bracketed paste - chopping trailing newlines) Axel Beckert
2015-08-30 20:37     ` bracketed paste - chopping trailing newlines Axel Beckert
2015-08-31  5:47     ` Daniel Shahaf
2015-09-01 23:44       ` Bart Schaefer
2015-09-02 15:41         ` Daniel Shahaf
2015-09-01 23:48     ` Bart Schaefer
2015-09-03 23:59       ` Carsten Hey
2015-09-06  9:52         ` Daniel Shahaf
2015-09-06 13:51           ` Oliver Kiddle
2015-09-06 14:21             ` Bart Schaefer
2015-09-08 10:39               ` Oliver Kiddle
2015-09-10 14:45                 ` Bart Schaefer
2015-09-10 19:11                 ` Daniel Shahaf
2015-09-11 23:07                   ` Bart Schaefer
2015-09-12  0:17                     ` Mikael Magnusson [this message]
2015-09-12 15:58                       ` Bart Schaefer
2015-09-14 20:35                     ` Daniel Shahaf
2015-09-14 21:21                       ` Bart Schaefer
2015-09-07  2:11             ` Daniel Shahaf
2015-09-08 23:33             ` Carsten Hey
2015-09-08 23:48               ` Carsten Hey
2015-09-10  8:24                 ` Peter Stephenson
2015-09-07 21:13           ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHYJk3RJg+1kSM6pq1ZirbwEjn0tZKV0pYdnTb8cPO5fC+wKtg@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).