0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.2274: newlines in 'balloonexpr' result only work in the GUI

Problem:    Newlines in 'balloonexpr' result only work in the GUI.
Solution:   Also recognize newlines in the terminal. (closes #5193)
This commit is contained in:
Bram Moolenaar
2019-11-09 16:59:14 +01:00
parent 4dd8fe0b4f
commit d1c1c82389
6 changed files with 21 additions and 15 deletions

View File

@@ -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;

View File

@@ -1,10 +1,10 @@
|o+0&#ffffff0|n>e| |o|n|e| |o|n|e| @38
@2|o| |t|X|o| |t|w|o| @38
|t|h|r|e| +0#0000001#ffd7ff255@21| +0#0000000#ffffff0@23
|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| |t|X|o| | +0#4040ff13#ffffff0@23
|~| @2| +0#0000001#ffd7ff255@21| +0#4040ff13#ffffff0@23
|t|h|r|e| +0#0000001#ffd7ff255@17| +0#0000000#ffffff0@27
|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| | +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255|t|X|o| @13| +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
|~| @48
|~| @48
|~| @48
|~| @48
|:+0#0000000&|c|a|l@1| |T|r|i|g@1|e|r|(|)| @16|1|,|3| @10|A|l@1|
|h+0#0000000&|o|l|d| |f|i|r|e|d| @39

View File

@@ -1,9 +1,9 @@
|o+0&#ffffff0|n>e| |o|n|e| |o|n|e| @38
@2|o| |t|X|o| |t|w|o| @38
|t|h|r|e| +0#0000001#ffd7ff255@21| +0#0000000#ffffff0@23
|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| |t|X|o| | +0#4040ff13#ffffff0@23
|~| @2| +0#0000001#ffd7ff255@21| +0#4040ff13#ffffff0@23
|~| @48
|t|h|r|e| +0#0000001#ffd7ff255@17| +0#0000000#ffffff0@27
|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| | +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255|t|X|o| @13| +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
|~| @48
|~| @48
|~| @48

View File

@@ -1,10 +1,10 @@
|o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @38
@2|o| |t|X|o| |t|w|o| @38
|t|h|r|e|e+0&#e0e0e08| |t|h>r+0&#ffffff0|e@1| |t|h|r|e@1| @32
|~+0#4040ff13&| @2| +0#0000001#ffd7ff255@23| +0#4040ff13#ffffff0@21
|~| @2| +0#0000001#ffd7ff255|l|i|n|e| |3| |c|o|l|u|m|n| |5|:| |e| |t|h|r| | +0#4040ff13#ffffff0@21
|~| @2| +0#0000001#ffd7ff255@23| +0#4040ff13#ffffff0@21
|~| @48
|~+0#4040ff13&| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255|l|i|n|e| |3| |c|o|l|u|m|n| |5|:| | +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255|e| |t|h|r| @11| +0#4040ff13#ffffff0@27
|~| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
|~| @48
|~| @48
|-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@9|5| @8|3|,|9| @10|A|l@1|

View File

@@ -12,7 +12,7 @@ let s:common_script =<< trim [CODE]
call setline(1, ["one one one", "two tXo two", "three three three"])
set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100
func MyBalloonExpr()
return "line " .. v:beval_lnum .. " column " .. v:beval_col .. ": " .. v:beval_text
return "line " .. v:beval_lnum .. " column " .. v:beval_col .. ":\n" .. v:beval_text
endfun
redraw
[CODE]

View File

@@ -741,6 +741,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
2274,
/**/
2273,
/**/