[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Converting cchar_t to wchar_t
From: |
Mike Gran |
Subject: |
Re: Converting cchar_t to wchar_t |
Date: |
Fri, 14 Jun 2019 11:34:27 -0700 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
On Fri, Jun 14, 2019 at 01:28:12PM -0500, Bryan Christ wrote:
> Ya. I realized that I could use getcchar() and setcchar() to handle the
> conversion. The root of my problem is that Mac OS appears to handle this
> code...
>
> wattr_set(vterm->window, attrs, colors, NULL);
> mvwadd_wch(vterm->window, r, c, &vcell->uch);
>
> ...slightly different on FreeBSD and Linux when the attributes in cchar_t
> (in this case vcell->uch) are not set. On FreeBSD and Linux the attrs from
> the wattr_set() are honored in the final render. On Mac OS, the cchar_t
> members attr and ext_colors appear to trump the other during the final
> render--effectively rendering them not visible. There may be more to this
> than meets the eye, but specifically syncing them up with setcchar() solves
> the problem.
In my code, after calling getcchar, I have the following line, which
may be relevant, that helps disambiguate attributes from color params.
/* Strip the color info from attr */
attr &= A_ATTRIBUTES ^ A_COLOR;
When reassembling using setcchar, you don't need any of this, I believe.
Regards,
Mike Gran