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:
@@ -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;
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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|
|
||||
|
@@ -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]
|
||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2274,
|
||||
/**/
|
||||
2273,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user