diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-11-09 16:59:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-11-09 16:59:14 +0100 |
commit | d1c1c823892d0713065934256f48e7f4e6609f99 (patch) | |
tree | 0c6baeb8e24ca82ab521e7f111d2bc7de80a84e8 /src/popupmenu.c | |
parent | 4dd8fe0b4f49ec267640fb457672452825b11df0 (diff) | |
download | vim-git-d1c1c823892d0713065934256f48e7f4e6609f99.tar.gz |
patch 8.1.2274: newlines in 'balloonexpr' result only work in the GUIv8.1.2274
Problem: Newlines in 'balloonexpr' result only work in the GUI.
Solution: Also recognize newlines in the terminal. (closes #5193)
Diffstat (limited to 'src/popupmenu.c')
-rw-r--r-- | src/popupmenu.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/popupmenu.c b/src/popupmenu.c index 005adb20b..55845cf2d 100644 --- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -1130,7 +1130,7 @@ split_message(char_u *mesg, pumitem_T **array) int item_idx; int indent = 0; int max_cells = 0; - int max_height = Rows / 2 - 2; + int max_height = Rows / 2 - 1; int long_item_count = 0; int split_long_items = FALSE; @@ -1150,6 +1150,8 @@ split_message(char_u *mesg, pumitem_T **array) { if (*p == '"') quoted = !quoted; + else if (*p == '\n') + break; else if (*p == '\\' && p[1] != NUL) ++p; else if (!quoted) @@ -1170,6 +1172,8 @@ split_message(char_u *mesg, pumitem_T **array) p += mb_ptr2len(p); } item->bytelen = p - item->start; + if (*p == '\n') + ++p; if (item->cells > max_cells) max_cells = item->cells; long_item_count += (item->cells - 1) / BALLOON_MIN_WIDTH; |