On Thu, Nov 15, 2012 at 03:25:52PM +0100, Eckehard Berns wrote:
> I added some code to make insert mode work in st. I don't know if I
> missed something, but It's Working For Me(tm). Patch attached.

I had a patch already ready for sending to solve this issue, but you were
faster ;). I put my code in tsetchar instead of tputc, but the code is
basically the same and the result is the same. It is ok.

Best regards.

> --
> Eckehard Berns

> diff -r 19ef42df8e7d st.c
> --- a/st.c    Wed Nov 14 06:37:24 2012 +0100
> +++ b/st.c    Thu Nov 15 15:19:52 2012 +0100
> @@ -2100,6 +2100,10 @@
>               sel.bx = -1;
>       if(IS_SET(MODE_WRAP) && term.c.state & CURSOR_WRAPNEXT)
>               tnewline(1); /* always go to first col */
> +     if(IS_SET(MODE_INSERT) && term.c.x+1 < term.col)
> +             memmove(&term.line[term.c.y][term.c.x+1],
> +                     &term.line[term.c.y][term.c.x],
> +                     (term.col - term.c.x - 1) * sizeof(Glyph));
>       tsetchar(c, &term.c.attr, term.c.x, term.c.y);
>       if(term.c.x+1 < term.col)
>               tmoveto(term.c.x+1, term.c.y);
> diff -r 19ef42df8e7d st.info
> --- a/st.info Wed Nov 14 06:37:24 2012 +0100
> +++ b/st.info Thu Nov 15 15:19:52 2012 +0100
> @@ -153,6 +153,7 @@
>       ritm=\E[23m,
>       rmacs=\E(B,
>       rmcup=\E[?1049l,
> +     rmir=\E[4l,
>       rmkx=\E[?1l\E>,
>       rmso=\E[23m,
>       rmul=\E[m,
> @@ -168,6 +169,7 @@
>       sitm=\E[3m,
>       smacs=\E(0,
>       smcup=\E[?1049h,
> +     smir=\E[4h,
>       smkx=\E[?1h\E=,
>       smso=\E[3m,
>       smul=\E[4m,

Reply via email to