Patch 8.1.1459

14 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 3, 2019, 4:22:12 PM6/3/19
to vim...@googlegroups.com

Patch 8.1.1459
Problem: Popup window border looks bad when 'ambiwidth' is "double".
(Yasuhiro Matsumoto)
Solution: Only use line drawing characters when 'ambiwidth' is "single".
(Ken Takata, closes #4477)
Files: src/screen.c


*** ../vim-8.1.1458/src/screen.c 2019-06-03 22:04:17.840244968 +0200
--- src/screen.c 2019-06-03 22:11:26.973743554 +0200
***************
*** 1078,1084 ****
+ wp->w_height + wp->w_popup_padding[2] + wp->w_popup_border[2];
popup_attr = get_wcr_attr(wp);

! if (enc_utf8)
{
border_char[0] = border_char[2] = 0x2550;
border_char[1] = border_char[3] = 0x2551;
--- 1078,1086 ----
+ wp->w_height + wp->w_popup_padding[2] + wp->w_popup_border[2];
popup_attr = get_wcr_attr(wp);

! // We can only use these line drawing characters when 'encoding' is
! // "utf-8" and 'ambiwidth' is "single".
! if (enc_utf8 && p_ambw == 's')
{
border_char[0] = border_char[2] = 0x2550;
border_char[1] = border_char[3] = 0x2551;
*** ../vim-8.1.1458/src/version.c 2019-06-03 22:04:17.840244968 +0200
--- src/version.c 2019-06-03 22:13:41.852963537 +0200
***************
*** 769,770 ****
--- 769,772 ----
{ /* Add new patch number below this line */
+ /**/
+ 1459,
/**/

--
From "know your smileys":
|-P Reaction to unusually ugly C code

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Dominique Pellé

unread,
Jun 3, 2019, 4:56:33 PM6/3/19
to vim_dev
This part of the patch 8.1.1459 looks incorrect:

*** ../vim-8.1.1458/src/screen.c 2019-06-03 22:04:17.840244968 +0200
--- src/screen.c 2019-06-03 22:11:26.973743554 +0200
***************
*** 1078,1084 ****
+ wp->w_height + wp->w_popup_padding[2] + wp->w_popup_border[2];
popup_attr = get_wcr_attr(wp);

! if (enc_utf8)
{
border_char[0] = border_char[2] = 0x2550;
border_char[1] = border_char[3] = 0x2551;
--- 1078,1086 ----
+ wp->w_height + wp->w_popup_padding[2] + wp->w_popup_border[2];
popup_attr = get_wcr_attr(wp);

! // We can only use these line drawing characters when 'encoding' is
! // "utf-8" and 'ambiwidth' is "single".
! if (enc_utf8 && p_ambw == 's')
{
border_char[0] = border_char[2] = 0x2550;
border_char[1] = border_char[3] = 0x2551;


It's most certainly meant to check the condition
*p_ambw == 's' rather than p_ambw == 's'.
otherwise it's comparing a pointer with character 's'
which makes no sense.

Regards
Dominique

Dominique Pellé

unread,
Jun 3, 2019, 4:59:13 PM6/3/19
to vim_dev
Never mind. I see that patch 8.1.1460 already fixed it.

Regards
Dominique

Bram Moolenaar

unread,
Jun 3, 2019, 5:12:06 PM6/3/19
to vim...@googlegroups.com, Dominique Pellé
Somehow I missed the compiler warning. Fixed now.
I also realized that the border characters from one popup were carried
over to the next one if this block was skipped. Also fixed.

--
From "know your smileys":
(:-# Said something he shouldn't have
Reply all
Reply to author
Forward
0 new messages