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

Re: Extend `zed' with status bar, is it possible?



On Sat, 20 Oct 2018 at 19:35, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> On Wed, Oct 17, 2018 at 10:10 PM Sebastian Gniazdowski
> <sgniazdowski@xxxxxxxxx> 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



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