• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Révision81272918c0eaad939eb6791d820667467b33b66c (tree)
l'heure2019-11-10 01:00:03
AuteurBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Message de Log

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

Commit: https://github.com/vim/vim/commit/d1c1c823892d0713065934256f48e7f4e6609f99
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 9 16:59:14 2019 +0100

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 https://github.com/vim/vim/issues/5193)

Change Summary

Modification

diff -r f983bf313b4d -r 81272918c0ea src/popupmenu.c
--- a/src/popupmenu.c Sat Nov 09 15:45:05 2019 +0100
+++ b/src/popupmenu.c Sat Nov 09 17:00:03 2019 +0100
@@ -1130,7 +1130,7 @@
11301130 int item_idx;
11311131 int indent = 0;
11321132 int max_cells = 0;
1133- int max_height = Rows / 2 - 2;
1133+ int max_height = Rows / 2 - 1;
11341134 int long_item_count = 0;
11351135 int split_long_items = FALSE;
11361136
@@ -1150,6 +1150,8 @@
11501150 {
11511151 if (*p == '"')
11521152 quoted = !quoted;
1153+ else if (*p == '\n')
1154+ break;
11531155 else if (*p == '\\' && p[1] != NUL)
11541156 ++p;
11551157 else if (!quoted)
@@ -1170,6 +1172,8 @@
11701172 p += mb_ptr2len(p);
11711173 }
11721174 item->bytelen = p - item->start;
1175+ if (*p == '\n')
1176+ ++p;
11731177 if (item->cells > max_cells)
11741178 max_cells = item->cells;
11751179 long_item_count += (item->cells - 1) / BALLOON_MIN_WIDTH;
diff -r f983bf313b4d -r 81272918c0ea src/testdir/dumps/Test_balloon_eval_term_01.dump
--- a/src/testdir/dumps/Test_balloon_eval_term_01.dump Sat Nov 09 15:45:05 2019 +0100
+++ b/src/testdir/dumps/Test_balloon_eval_term_01.dump Sat Nov 09 17:00:03 2019 +0100
@@ -1,10 +1,10 @@
11 |o+0&#ffffff0|n>e| |o|n|e| |o|n|e| @38
22 @2|o| |t|X|o| |t|w|o| @38
3-|t|h|r|e| +0#0000001#ffd7ff255@21| +0#0000000#ffffff0@23
4-|~+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
5-|~| @2| +0#0000001#ffd7ff255@21| +0#4040ff13#ffffff0@23
3+|t|h|r|e| +0#0000001#ffd7ff255@17| +0#0000000#ffffff0@27
4+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| | +0#4040ff13#ffffff0@27
5+|~| @2| +0#0000001#ffd7ff255|t|X|o| @13| +0#4040ff13#ffffff0@27
6+|~| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
67 |~| @48
78 |~| @48
89 |~| @48
9-|~| @48
10-|:+0#0000000&|c|a|l@1| |T|r|i|g@1|e|r|(|)| @16|1|,|3| @10|A|l@1|
10+|h+0#0000000&|o|l|d| |f|i|r|e|d| @39
diff -r f983bf313b4d -r 81272918c0ea src/testdir/dumps/Test_balloon_eval_term_01a.dump
--- a/src/testdir/dumps/Test_balloon_eval_term_01a.dump Sat Nov 09 15:45:05 2019 +0100
+++ b/src/testdir/dumps/Test_balloon_eval_term_01a.dump Sat Nov 09 17:00:03 2019 +0100
@@ -1,9 +1,9 @@
11 |o+0&#ffffff0|n>e| |o|n|e| |o|n|e| @38
22 @2|o| |t|X|o| |t|w|o| @38
3-|t|h|r|e| +0#0000001#ffd7ff255@21| +0#0000000#ffffff0@23
4-|~+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
5-|~| @2| +0#0000001#ffd7ff255@21| +0#4040ff13#ffffff0@23
6-|~| @48
3+|t|h|r|e| +0#0000001#ffd7ff255@17| +0#0000000#ffffff0@27
4+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255|l|i|n|e| |2| |c|o|l|u|m|n| |6|:| | +0#4040ff13#ffffff0@27
5+|~| @2| +0#0000001#ffd7ff255|t|X|o| @13| +0#4040ff13#ffffff0@27
6+|~| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
77 |~| @48
88 |~| @48
99 |~| @48
diff -r f983bf313b4d -r 81272918c0ea src/testdir/dumps/Test_balloon_eval_term_02.dump
--- a/src/testdir/dumps/Test_balloon_eval_term_02.dump Sat Nov 09 15:45:05 2019 +0100
+++ b/src/testdir/dumps/Test_balloon_eval_term_02.dump Sat Nov 09 17:00:03 2019 +0100
@@ -1,10 +1,10 @@
11 |o+0&#ffffff0|n|e| |o|n|e| |o|n|e| @38
22 @2|o| |t|X|o| |t|w|o| @38
33 |t|h|r|e|e+0&#e0e0e08| |t|h>r+0&#ffffff0|e@1| |t|h|r|e@1| @32
4-|~+0#4040ff13&| @2| +0#0000001#ffd7ff255@23| +0#4040ff13#ffffff0@21
5-|~| @2| +0#0000001#ffd7ff255|l|i|n|e| |3| |c|o|l|u|m|n| |5|:| |e| |t|h|r| | +0#4040ff13#ffffff0@21
6-|~| @2| +0#0000001#ffd7ff255@23| +0#4040ff13#ffffff0@21
7-|~| @48
4+|~+0#4040ff13&| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
5+|~| @2| +0#0000001#ffd7ff255|l|i|n|e| |3| |c|o|l|u|m|n| |5|:| | +0#4040ff13#ffffff0@27
6+|~| @2| +0#0000001#ffd7ff255|e| |t|h|r| @11| +0#4040ff13#ffffff0@27
7+|~| @2| +0#0000001#ffd7ff255@17| +0#4040ff13#ffffff0@27
88 |~| @48
99 |~| @48
1010 |-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@9|5| @8|3|,|9| @10|A|l@1|
diff -r f983bf313b4d -r 81272918c0ea src/testdir/test_balloon.vim
--- a/src/testdir/test_balloon.vim Sat Nov 09 15:45:05 2019 +0100
+++ b/src/testdir/test_balloon.vim Sat Nov 09 17:00:03 2019 +0100
@@ -12,7 +12,7 @@
1212 call setline(1, ["one one one", "two tXo two", "three three three"])
1313 set balloonevalterm balloonexpr=MyBalloonExpr() balloondelay=100
1414 func MyBalloonExpr()
15- return "line " .. v:beval_lnum .. " column " .. v:beval_col .. ": " .. v:beval_text
15+ return "line " .. v:beval_lnum .. " column " .. v:beval_col .. ":\n" .. v:beval_text
1616 endfun
1717 redraw
1818 [CODE]
diff -r f983bf313b4d -r 81272918c0ea src/version.c
--- a/src/version.c Sat Nov 09 15:45:05 2019 +0100
+++ b/src/version.c Sat Nov 09 17:00:03 2019 +0100
@@ -742,6 +742,8 @@
742742 static int included_patches[] =
743743 { /* Add new patch number below this line */
744744 /**/
745+ 2274,
746+/**/
745747 2273,
746748 /**/
747749 2272,
Afficher sur ancien navigateur de dépôt.