To: vim_dev@googlegroups.com Subject: Patch 8.2.0007 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0007 Problem: Popup menu positioned wrong with folding in two tabs. Solution: Update the cursor line height. (closes #5353) Files: src/move.c, src/proto/move.pro, src/popupmenu.c, src/testdir/test_ins_complete.vim, src/testdir/dumps/Test_pum_with_folds_two_tabs.dump *** ../vim-8.2.0006/src/move.c 2019-11-30 22:40:44.000000000 +0100 --- src/move.c 2019-12-14 18:35:23.881249850 +0100 *************** *** 816,822 **** /* * Validate curwin->w_cline_height only. */ ! static void validate_cheight(void) { check_cursor_moved(curwin); --- 816,822 ---- /* * Validate curwin->w_cline_height only. */ ! void validate_cheight(void) { check_cursor_moved(curwin); *** ../vim-8.2.0006/src/proto/move.pro 2019-12-12 12:55:28.000000000 +0100 --- src/proto/move.pro 2019-12-14 18:35:50.089159011 +0100 *************** *** 21,26 **** --- 21,27 ---- void validate_cline_row(void); void validate_virtcol(void); void validate_virtcol_win(win_T *wp); + void validate_cheight(void); void validate_cursor_col(void); int win_col_off(win_T *wp); int curwin_col_off(void); *** ../vim-8.2.0006/src/popupmenu.c 2019-12-10 21:50:04.000000000 +0100 --- src/popupmenu.c 2019-12-14 18:36:16.465066033 +0100 *************** *** 180,185 **** --- 180,186 ---- // pum below "pum_win_row" // Leave two lines of context if possible + validate_cheight(); if (curwin->w_cline_row + curwin->w_cline_height - curwin->w_wrow >= 3) context_lines = 3; *** ../vim-8.2.0006/src/testdir/test_ins_complete.vim 2019-08-02 19:51:05.000000000 +0200 --- src/testdir/test_ins_complete.vim 2019-12-14 18:20:23.148304145 +0100 *************** *** 1,3 **** --- 1,4 ---- + source screendump.vim source check.vim " Test for insert expansion *************** *** 380,382 **** --- 381,406 ---- set completeslash= endfunc + func Test_pum_with_folds_two_tabs() + CheckScreendump + + let lines =<< trim END + set fdm=marker + call setline(1, ['" x {{{1', '" a some text']) + call setline(3, range(&lines)->map({_, val -> '" a' .. val})) + norm! zm + tab sp + call feedkeys('2Gzv', 'xt') + call feedkeys("0fa", 'xt') + END + + call writefile(lines, 'Xpumscript') + let buf = RunVimInTerminal('-S Xpumscript', #{rows: 10}) + call term_wait(buf, 100) + call term_sendkeys(buf, "a\") + call VerifyScreenDump(buf, 'Test_pum_with_folds_two_tabs', {}) + + call term_sendkeys(buf, "\") + call StopVimInTerminal(buf) + call delete('Xpumscript') + endfunc *** ../vim-8.2.0006/src/testdir/dumps/Test_pum_with_folds_two_tabs.dump 2019-12-14 18:41:40.211687947 +0100 --- src/testdir/dumps/Test_pum_with_folds_two_tabs.dump 2019-12-14 18:39:17.428280089 +0100 *************** *** 0 **** --- 1,10 ---- + | +8#0000001#e0e0e08|+| |[|N|o| |N|a|m|e|]| | +2#0000000#ffffff0|+| |[|N|o| |N|a|m|e|]| | +1&&@47|X+8#0000001#e0e0e08 + |"+0#0000000#ffffff0| |x| |{@2|1| @66 + |"| |a|0> |s|o|m|e| |t|e|x|t| @60 + |"| +0#0000001#e0e0e08|a|0| @12| +0#0000000#0000001| +0&#ffffff0@56 + |"| +0#0000001#ffd7ff255|a|1| @12| +0#0000000#0000001| +0&#ffffff0@56 + |"| +0#0000001#ffd7ff255|a|2| @12| +0#0000000#0000001| +0&#ffffff0@56 + |"| +0#0000001#ffd7ff255|a|3| @12| +0#0000000#a8a8a8255| +0&#ffffff0@56 + |"| +0#0000001#ffd7ff255|a|4| @12| +0#0000000#a8a8a8255| +0&#ffffff0@56 + |"| +0#0000001#ffd7ff255|a|5| @12| +0#0000000#a8a8a8255| +0&#ffffff0@56 + |-+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 *** ../vim-8.2.0006/src/version.c 2019-12-14 17:52:37.253322578 +0100 --- src/version.c 2019-12-14 18:36:31.916997012 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 7, /**/ -- We're knights of the Round Table Our shows are formidable But many times We're given rhymes That are quite unsingable We're opera mad in Camelot We sing from the diaphragm a lot. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///