Re: [dev] [RFC] Design of a vim like text editor

From: Marc André Tanner <mat_AT_brain-dump.org>
Date: Tue, 16 Sep 2014 21:01:20 +0200

On Tue, Sep 16, 2014 at 01:56:14PM +0200, Gregor Best wrote:
> Hi guys,
>
> I've got two patches and three questions:
>
> First, the patches. The first fixes editing of length 0 files,

Thanks applied with some cosmetic changes. I'm not sure the perror call makes
that much sense and since the other error paths do not contain it, I've left
it out for now.

> the second fixes
> compilation on OpenBSD. Since _BSD_SOURCE was already present in other files
> belonging to vis, I figured adding it to vis.c as well poses no harm.

I actually also got another patch related to these defines:

  This fixes warning with latest glibc (>= 2.19.90), which deprecated _BSD_SOURCE

  warning: _BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE

I saw that musl also added support for _DEFAULT_SOURCE in a recent commit.

Therefore I'm adding:

#define _DEFAULT_SOURCE
#define _POSIX_SOURCE /* needed for sigaction */
#define _BSD_SOURCE /* needed for OpenBSD SIGWINCH */

Could a libc expert (nsz if you happen to read this?) comment on whether this
makes sense or to what should be used instead?

> The first question is about line numbers. Would a patch adding display of line
> numbers be accepted, or is that considered unnecessary cruft? I find it makes
> jumping through a file a bit easier.

If there exists a way to disable them, then yes. This should basically amount
to a loop from win->topline till win->lastline always printing line->lineno.

> My other question is about piping (part of) the buffer to an external command,
> such as fmt. Is someone already working on that or is that something I could
> start looking into? Piping would also provide a (stop-gap) solution for :s, for
> example by piping to sed or some other stream editor.

I agree this is needed, feel free to work on it ...

> I'm also seeing quite a bit of display corruption when opening large syntax
> highlighted files, such as window.c and scrolling around the file for a while.
> Is anyone else seeing that or is it just me? I'm using tmux and st, if that
> matters.

Could you elaborate a bit more on what you mean by corruption? Wrong syntax
highlighting / colors, text not showing up at all ...

If "just" the colors are screwed up, it is probably due to a recent commit
which tries to make syntax highlighting more efficient. I will have to take
another look.

In any case make sure to use the latest git version which has some code
cleanups in window.c (not related to drawing though).

Thanks,

-- 
 Marc André Tanner >< http://www.brain-dump.org/ >< GPG key: CF7D56C0
Received on Tue Sep 16 2014 - 21:01:20 CEST

This archive was generated by hypermail 2.3.0 : Tue Sep 16 2014 - 21:12:07 CEST