comparison src/screen.c @ 16918:21cddcc6fbe8 v8.1.1460

patch 8.1.1460: popup window border characters may be wrong commit https://github.com/vim/vim/commit/02e15072be08ef4ae03d673fc95ed6234e749e1c Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 3 22:53:30 2019 +0200 patch 8.1.1460: popup window border characters may be wrong Problem: Popup window border characters may be wrong. Solution: Reset the border characters for each popup. Correct use of 'ambiwidth'.
author Bram Moolenaar <Bram@vim.org>
date Mon, 03 Jun 2019 23:00:06 +0200
parents 90cec755ff80
children 03f3a9ca2770
comparison
equal deleted inserted replaced
16917:08636baae49f 16918:21cddcc6fbe8
1039 int left_off; 1039 int left_off;
1040 int total_width; 1040 int total_width;
1041 int total_height; 1041 int total_height;
1042 int popup_attr; 1042 int popup_attr;
1043 int border_attr[4]; 1043 int border_attr[4];
1044 int border_char[8] = {'-', '|', '-', '|', '+', '+', '+', '+', }; 1044 int border_char[8];
1045 char_u buf[MB_MAXBYTES]; 1045 char_u buf[MB_MAXBYTES];
1046 int row; 1046 int row;
1047 int i; 1047 int i;
1048 1048
1049 // Find the window with the lowest zindex that hasn't been updated yet, 1049 // Find the window with the lowest zindex that hasn't been updated yet,
1078 + wp->w_height + wp->w_popup_padding[2] + wp->w_popup_border[2]; 1078 + wp->w_height + wp->w_popup_padding[2] + wp->w_popup_border[2];
1079 popup_attr = get_wcr_attr(wp); 1079 popup_attr = get_wcr_attr(wp);
1080 1080
1081 // We can only use these line drawing characters when 'encoding' is 1081 // We can only use these line drawing characters when 'encoding' is
1082 // "utf-8" and 'ambiwidth' is "single". 1082 // "utf-8" and 'ambiwidth' is "single".
1083 if (enc_utf8 && p_ambw == 's') 1083 if (enc_utf8 && *p_ambw == 's')
1084 { 1084 {
1085 border_char[0] = border_char[2] = 0x2550; 1085 border_char[0] = border_char[2] = 0x2550;
1086 border_char[1] = border_char[3] = 0x2551; 1086 border_char[1] = border_char[3] = 0x2551;
1087 border_char[4] = 0x2554; 1087 border_char[4] = 0x2554;
1088 border_char[5] = 0x2557; 1088 border_char[5] = 0x2557;
1089 border_char[6] = 0x255d; 1089 border_char[6] = 0x255d;
1090 border_char[7] = 0x255a; 1090 border_char[7] = 0x255a;
1091 }
1092 else
1093 {
1094 border_char[0] = border_char[2] = '-';
1095 border_char[1] = border_char[3] = '|';
1096 for (i = 4; i < 8; ++i)
1097 border_char[i] = '+';
1091 } 1098 }
1092 for (i = 0; i < 8; ++i) 1099 for (i = 0; i < 8; ++i)
1093 if (wp->w_border_char[i] != 0) 1100 if (wp->w_border_char[i] != 0)
1094 border_char[i] = wp->w_border_char[i]; 1101 border_char[i] = wp->w_border_char[i];
1095 1102