From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Daniel Shahaf <d.s@daniel.shahaf.name>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Could this function (zaccu-process-buffer) be added?
Date: Thu, 8 Sep 2016 17:27:30 +0200 [thread overview]
Message-ID: <CAKc7PVB5UoU+ypNOQ0PM+5F2UozST+11bkp7vZqYcP7CWQBcsA@mail.gmail.com> (raw)
In-Reply-To: <20160908121716.GA5468@fujitsu.shahaf.local2>
On 8 September 2016 at 14:17, Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
>
> Next time please say in the email itself what the function does. That
> would make it easier for your readers to understand your message.
>
> My understanding is that the function presents an API to ${(z)BUFFER}.
> (Correct me if that's inaccurate.)
Yes. I included the link as first thing in message, thinking that
anyone would just take a look rather than read my message.
>
> z-sy-h has code that splits the command-line to words with (z) and
> tracks indices. I know you know that because you helped optimise it
> :-). I don't know which code better solves this problem, z-sy-h's or
> zaccu's. The former has not been spun off into a reusable function but
> it could be.
>
> https://github.com/zsh-users/zsh-syntax-highlighting/blob/da60234fb236ccd2b199ffa8a157014dacf4e591/highlighters/main/main-highlighter.zsh#L299-L336
My function is more basic, too bad no one has time to interpret code,
even when it's plain simple. The whole thing is around this line:
# Remove white spaces
buf="${buf##(#m)[^$word[1]]#}"
Which removes white spaces also storing them. Rest is careful indexing
and decisions whether a word is selected or not, things that make a
headache when writing, from what is the value of the function.
Best regards,
Sebastian Gniazdowski
prev parent reply other threads:[~2016-09-08 15:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-07 10:50 Sebastian Gniazdowski
2016-09-08 12:17 ` Daniel Shahaf
2016-09-08 15:27 ` Sebastian Gniazdowski [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=CAKc7PVB5UoU+ypNOQ0PM+5F2UozST+11bkp7vZqYcP7CWQBcsA@mail.gmail.com \
--to=sgniazdowski@gmail.com \
--cc=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).