summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-03 22:53:30 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-03 22:53:30 +0200
commit02e15072be08ef4ae03d673fc95ed6234e749e1c (patch)
tree7671365ce8736c59a23365bfd4be5ebe3d0a4508
parent3f6aeba18b3e29da98ab9326e66d287a997d98d1 (diff)
downloadvim-git-02e15072be08ef4ae03d673fc95ed6234e749e1c.tar.gz
patch 8.1.1460: popup window border characters may be wrongv8.1.1460
Problem: Popup window border characters may be wrong. Solution: Reset the border characters for each popup. Correct use of 'ambiwidth'.
-rw-r--r--src/screen.c11
-rw-r--r--src/version.c2
2 files changed, 11 insertions, 2 deletions
diff --git a/src/screen.c b/src/screen.c
index d72d7792c..8092fd244 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -1041,7 +1041,7 @@ update_popups(void)
int total_height;
int popup_attr;
int border_attr[4];
- int border_char[8] = {'-', '|', '-', '|', '+', '+', '+', '+', };
+ int border_char[8];
char_u buf[MB_MAXBYTES];
int row;
int i;
@@ -1080,7 +1080,7 @@ update_popups(void)
// We can only use these line drawing characters when 'encoding' is
// "utf-8" and 'ambiwidth' is "single".
- if (enc_utf8 && p_ambw == 's')
+ if (enc_utf8 && *p_ambw == 's')
{
border_char[0] = border_char[2] = 0x2550;
border_char[1] = border_char[3] = 0x2551;
@@ -1089,6 +1089,13 @@ update_popups(void)
border_char[6] = 0x255d;
border_char[7] = 0x255a;
}
+ else
+ {
+ border_char[0] = border_char[2] = '-';
+ border_char[1] = border_char[3] = '|';
+ for (i = 4; i < 8; ++i)
+ border_char[i] = '+';
+ }
for (i = 0; i < 8; ++i)
if (wp->w_border_char[i] != 0)
border_char[i] = wp->w_border_char[i];
diff --git a/src/version.c b/src/version.c
index accea72f1..eeaa5efc8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -768,6 +768,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1460,
+/**/
1459,
/**/
1458,