Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

(m)-flag for boundary cases



Hello,

% a="漢字"
% echo ${(mr:3::_:)a}
漢字
% echo ${(mr:2::_:)a}
漢

I think it would be better to trim first case down to single Asian
character, and display: 漢_. The point is that it gives predictable
width. Current version is occasionally 1 character too long.

I wonder how many people use (m)-flag. Never seen it mentioned here. I
think that nobody wants the off-by-1 behavior, and fixing it will not
break things, but make them automatically better, like for me – the flag
turned out to be a necessity and a solution, with acceptable off-by-1
problem, which will be automatically fixed by Zsh update. I've added
Asian characters support to ZUI via the flag, most important use case is
the (r) padding, but also good cooperation with (P) flag.

-- 
  Sebastian Gniazdowski
  psprint3@xxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author