To: vim_dev@googlegroups.com Subject: Patch 8.1.2274 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2274 Problem: Newlines in 'balloonexpr' result only work in the GUI. Solution: Also recognize newlines in the terminal. (closes #5193) Files: src/popupmenu.c, src/testdir/test_balloon.vim, src/testdir/dumps/Test_balloon_eval_term_01.dump, src/testdir/dumps/Test_balloon_eval_term_01a.dump, src/testdir/dumps/Test_balloon_eval_term_02.dump *** ../vim-8.1.2273/src/popupmenu.c 2019-10-20 18:17:08.363431719 +0200 --- src/popupmenu.c 2019-11-09 16:45:01.824055108 +0100 *************** *** 1130,1136 **** int item_idx; int indent = 0; int max_cells = 0; ! int max_height = Rows / 2 - 2; int long_item_count = 0; int split_long_items = FALSE; --- 1130,1136 ---- int item_idx; int indent = 0; int max_cells = 0; ! int max_height = Rows / 2 - 1; int long_item_count = 0; int split_long_items = FALSE; *************** *** 1150,1155 **** --- 1150,1157 ---- { if (*p == '"') quoted = !quoted; + else if (*p == '\n') + break; else if (*p == '\\' && p[1] != NUL) ++p; else if (!quoted) *************** *** 1170,1175 **** --- 1172,1179 ---- 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; *** ../vim-8.1.2273/src/testdir/test_balloon.vim 2019-08-07 23:07:03.960858821 +0200 --- src/testdir/test_balloon.vim 2019-11-09 16:37:07.982891379 +0100 *************** *** 12,18 **** 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 endfun redraw [CODE] --- 12,18 ---- 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 .. ":\n" .. v:beval_text endfun redraw [CODE] *** ../vim-8.1.2273/src/testdir/dumps/Test_balloon_eval_term_01.dump 2019-07-05 23:24:39.158501402 +0200 --- src/testdir/dumps/Test_balloon_eval_term_01.dump 2019-11-09 16:45:21.319939963 +0100 *************** *** 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 |~| @48 |~| @48 |~| @48 ! |~| @48 ! |:+0#0000000&|c|a|l@1| |T|r|i|g@1|e|r|(|)| @16|1|,|3| @10|A|l@1| --- 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@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 ! |h+0#0000000&|o|l|d| |f|i|r|e|d| @39 *** ../vim-8.1.2273/src/testdir/dumps/Test_balloon_eval_term_01a.dump 2019-07-05 23:24:39.158501402 +0200 --- src/testdir/dumps/Test_balloon_eval_term_01a.dump 2019-11-09 16:46:23.991570401 +0100 *************** *** 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 |~| @48 |~| @48 |~| @48 --- 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@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 *** ../vim-8.1.2273/src/testdir/dumps/Test_balloon_eval_term_02.dump 2019-05-08 22:54:26.023509040 +0200 --- src/testdir/dumps/Test_balloon_eval_term_02.dump 2019-11-09 16:45:27.063906057 +0100 *************** *** 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 |~| @48 |~| @48 |-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@9|5| @8|3|,|9| @10|A|l@1| --- 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@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| *** ../vim-8.1.2273/src/version.c 2019-11-09 15:32:51.597873973 +0100 --- src/version.c 2019-11-09 16:26:48.090847574 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2274, /**/ -- The real trick is this: to keep the lines as short as possible and keep the size the same yet free from the need for hyphena- Dammit!! (Matthew Winn) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///