zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] vared: Escape empty elements of arrays
Date: Thu, 21 May 2020 16:32:34 +0000	[thread overview]
Message-ID: <20200521163234.328a1be2@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <52503-1590058644.696341@0c4k.-v5l.VV1->

Oliver Kiddle wrote on Thu, 21 May 2020 12:57 +0200:
> Daniel Shahaf wrote:
> > — it seems to be impossible for the result of a vared operation to
> > include empty elements.  In particular, editing an array with empty
> > elements in master silently drops them.  With the patch, the elements
> > would become «''» (two bytes).  
> 
> For editing arrays, I typically use the following:
> 
>   alias lvared="IFS=\$'\n\n' vared"
> 
> That preserves empty elements from blank lines.

Thanks!  I'll see if I can add this to the manual as a tip.  And maybe
emit a warning if an array is edited that has empty elements.

      reply	other threads:[~2020-05-21 16:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 23:54 Daniel Shahaf
2020-05-21  7:05 ` Daniel Shahaf
2020-05-21 10:57   ` Oliver Kiddle
2020-05-21 16:32     ` Daniel Shahaf [this message]

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=20200521163234.328a1be2@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --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).