zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Extend `zed' with status bar, is it possible?
Date: Sat, 20 Oct 2018 23:40:39 +0200	[thread overview]
Message-ID: <CAKc7PVBqmKd12NVrUbMLyzWhPGd9E9LVhy2-MXaMpRT6xiWLtQ@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7bzMY3wwU+21eK8b-g4a=CQgxi6d1_PNTsV8sHoJevHnw@mail.gmail.com>

On Sat, 20 Oct 2018 at 19:35, Bart Schaefer <schaefer@brasslantern.com> wrote:
>
> On Wed, Oct 17, 2018 at 10:10 PM Sebastian Gniazdowski
> <sgniazdowski@gmail.com> wrote:
> >
> > I'm looking at vared and it seems that there is no way to
> > replace/append-to vared's last line (last POSTDISPLAY line?) with some
> > custom contents, basically a status bar. Does someone know a way?
>
> Do you mean a status that changes in some way during vared execution,
> like showing the line/column of the cursor position or similar?
>
> If all you want is to set POSTDISPLAY on entry, you can do it by
> passing a line-init widget to "vared -i ...".  However, POSTDISPLAY
> only appears after the bottom of the entire multi-line buffer, so if
> you're editing something that fills more than one screen you only see
> it on the last page.

Tried it, behaves like described, but also isn't permanent, the added
line disappears when going to other page and then back to the last
one.

> I was going to suggest using "vared -r" to set the right prompt, but
> that doesn't work correctly either; it's visible only at the top of
> the first page and then only the first time it might appear, it never
> gets redrawn as you scroll up and down.  And if you set the "vared -p"
> prompt to something that contains a newline, everything to the left of
> the newline eventually disappears if you scroll to a second screen and
> back.  Seems that the only things handled correctly are PREDISPLAY and
> POSTDISPLAY.

The tmux version would work very well. I know this seams a no-go to
use some somewhat large foreign binary project to hack vared, but it's
like git using perl for many of its subcommands – I've read that
someone wrote "A machine without perl is essentially broken to me" in
this context. Tmux isn't as that much widespread as perl, but is also
a basic command commonly available. So it's a reason to be happy that
such command can provide /dev/tty* for vared, to open 2 windows, with
a status bar in one of them, with e.g. vim mode and current line. I've
described use of tmux in other post in this thread. Maybe you could
guess what bad happens with stdin/stdout so that tmux cannot start for
the second time.

--
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

      reply	other threads:[~2018-10-20 21:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18  5:10 Sebastian Gniazdowski
2018-10-18 16:27 ` Sebastian Gniazdowski
2018-10-20 17:35 ` Bart Schaefer
2018-10-20 21:40   ` 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=CAKc7PVBqmKd12NVrUbMLyzWhPGd9E9LVhy2-MXaMpRT6xiWLtQ@mail.gmail.com \
    --to=sgniazdowski@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).