From: Bart Schaefer <schaefer@brasslantern.com>
To: zsh-workers@zsh.org
Subject: Re: (m)-flag for boundary cases
Date: Mon, 20 Mar 2017 09:43:33 -0700 [thread overview]
Message-ID: <170320094333.ZM29062@torch.brasslantern.com> (raw)
In-Reply-To: <1490020425.2614066.917182456.0E56E387@webmail.messagingengine.com>
On Mar 20, 7:33am, Sebastian Gniazdowski wrote:
} Subject: (m)-flag for boundary cases
}
} Hello,
}
} % a="0x6F220x5B57"
} % echo ${(mr:3::_:)a}
} 0x6F220x5B57
} % echo ${(mr:2::_:)a}
} 0x6F22
}
} I think it would be better to trim first case down to single Asian
} character, and display: 0x6F22_. The point is that it gives predictable
} width.
Try this? Works for characters that are 2 columns wide. If you have
a mix of character widths, probably a custom math function to use in the
subscript ...
dw=3 # Desired width
echo ${(mr:dw::_:)a[1,${(m)#a[1,dw-1]}>dw?dw/2:dw]}
next prev parent reply other threads:[~2017-03-20 16:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-20 14:33 Sebastian Gniazdowski
2017-03-20 16:00 ` Sebastian Gniazdowski
2017-03-20 16:43 ` Bart Schaefer [this message]
2017-03-21 13:02 Sebastian Gniazdowski
2017-04-02 22:57 ` Bart Schaefer
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=170320094333.ZM29062@torch.brasslantern.com \
--to=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).