• R/O
  • SSH

vim: 提交

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


Commit MetaInfo

修订版fb2d26bc8ca159c7eb29ceb1a9354ac1deb366fd (tree)
时间2019-12-15 02:45:04
作者Bram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 8.2.0007: popup menu positioned wrong with folding in two tabs

Commit: https://github.com/vim/vim/commit/09dd2bb3364cc8fb5a8f2507bc2f4ceba481db3d
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 14 18:42:15 2019 +0100

patch 8.2.0007: popup menu positioned wrong with folding in two tabs
Problem: Popup menu positioned wrong with folding in two tabs.
Solution: Update the cursor line height. (closes https://github.com/vim/vim/issues/5353)

更改概述

差异

diff -r 84747442f5e2 -r fb2d26bc8ca1 src/move.c
--- a/src/move.c Sat Dec 14 18:00:04 2019 +0100
+++ b/src/move.c Sat Dec 14 18:45:04 2019 +0100
@@ -816,7 +816,7 @@
816816 /*
817817 * Validate curwin->w_cline_height only.
818818 */
819- static void
819+ void
820820 validate_cheight(void)
821821 {
822822 check_cursor_moved(curwin);
diff -r 84747442f5e2 -r fb2d26bc8ca1 src/popupmenu.c
--- a/src/popupmenu.c Sat Dec 14 18:00:04 2019 +0100
+++ b/src/popupmenu.c Sat Dec 14 18:45:04 2019 +0100
@@ -180,6 +180,7 @@
180180 // pum below "pum_win_row"
181181
182182 // Leave two lines of context if possible
183+ validate_cheight();
183184 if (curwin->w_cline_row
184185 + curwin->w_cline_height - curwin->w_wrow >= 3)
185186 context_lines = 3;
diff -r 84747442f5e2 -r fb2d26bc8ca1 src/proto/move.pro
--- a/src/proto/move.pro Sat Dec 14 18:00:04 2019 +0100
+++ b/src/proto/move.pro Sat Dec 14 18:45:04 2019 +0100
@@ -21,6 +21,7 @@
2121 void validate_cline_row(void);
2222 void validate_virtcol(void);
2323 void validate_virtcol_win(win_T *wp);
24+void validate_cheight(void);
2425 void validate_cursor_col(void);
2526 int win_col_off(win_T *wp);
2627 int curwin_col_off(void);
diff -r 84747442f5e2 -r fb2d26bc8ca1 src/testdir/dumps/Test_pum_with_folds_two_tabs.dump
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/testdir/dumps/Test_pum_with_folds_two_tabs.dump Sat Dec 14 18:45:04 2019 +0100
@@ -0,0 +1,10 @@
1+| +8#0000001#e0e0e08|+| |[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|+| |[|N|o| |N|a|m|e|]| | +1&&@47|X+8#0000001#e0e0e08
2+|"+0#0000000#ffffff0| |x| |{@2|1| @66
3+|"| |a|0> |s|o|m|e| |t|e|x|t| @60
4+|"| +0#0000001#e0e0e08|a|0| @12| +0#0000000#0000001| +0&#ffffff0@56
5+|"| +0#0000001#ffd7ff255|a|1| @12| +0#0000000#0000001| +0&#ffffff0@56
6+|"| +0#0000001#ffd7ff255|a|2| @12| +0#0000000#0000001| +0&#ffffff0@56
7+|"| +0#0000001#ffd7ff255|a|3| @12| +0#0000000#a8a8a8255| +0&#ffffff0@56
8+|"| +0#0000001#ffd7ff255|a|4| @12| +0#0000000#a8a8a8255| +0&#ffffff0@56
9+|"| +0#0000001#ffd7ff255|a|5| @12| +0#0000000#a8a8a8255| +0&#ffffff0@56
10+|-+2&&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|0| +0#0000000&@32
diff -r 84747442f5e2 -r fb2d26bc8ca1 src/testdir/test_ins_complete.vim
--- a/src/testdir/test_ins_complete.vim Sat Dec 14 18:00:04 2019 +0100
+++ b/src/testdir/test_ins_complete.vim Sat Dec 14 18:45:04 2019 +0100
@@ -1,3 +1,4 @@
1+source screendump.vim
12 source check.vim
23
34 " Test for insert expansion
@@ -380,3 +381,26 @@
380381 set completeslash=
381382 endfunc
382383
384+func Test_pum_with_folds_two_tabs()
385+ CheckScreendump
386+
387+ let lines =<< trim END
388+ set fdm=marker
389+ call setline(1, ['" x {{{1', '" a some text'])
390+ call setline(3, range(&lines)->map({_, val -> '" a' .. val}))
391+ norm! zm
392+ tab sp
393+ call feedkeys('2Gzv', 'xt')
394+ call feedkeys("0fa", 'xt')
395+ END
396+
397+ call writefile(lines, 'Xpumscript')
398+ let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10})
399+ call term_wait(buf, 100)
400+ call term_sendkeys(buf, "a\<C-N>")
401+ call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {})
402+
403+ call term_sendkeys(buf, "\<Esc>")
404+ call StopVimInTerminal(buf)
405+ call delete('Xpumscript')
406+endfunc
diff -r 84747442f5e2 -r fb2d26bc8ca1 src/version.c
--- a/src/version.c Sat Dec 14 18:00:04 2019 +0100
+++ b/src/version.c Sat Dec 14 18:45:04 2019 +0100
@@ -743,6 +743,8 @@
743743 static int included_patches[] =
744744 { /* Add new patch number below this line */
745745 /**/
746+ 7,
747+/**/
746748 6,
747749 /**/
748750 5,
Show on old repository browser