Mercurial > vim
comparison src/testdir/test_popupwin.vim @ 21339:608f674c6035 v8.2.1220
patch 8.2.1220: memory access error when dragging a popup window
Commit: https://github.com/vim/vim/commit/452143c6bf0dcf76ef415281b0e4fbc3edff4b6b
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 15 17:38:21 2020 +0200
patch 8.2.1220: memory access error when dragging a popup window
Problem: memory access error when dragging a popup window over a buffer
with folding.
Solution: Avoid going over the end of the cache. (closes #6438)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 15 Jul 2020 17:45:03 +0200 |
parents | 3fd32bf5fff0 |
children | 3d73cdd173ab |
comparison
equal
deleted
inserted
replaced
21338:84baaef59d19 | 21339:608f674c6035 |
---|---|
582 CheckScreendump | 582 CheckScreendump |
583 CheckFeature terminal | 583 CheckFeature terminal |
584 | 584 |
585 " create a popup that covers the terminal window | 585 " create a popup that covers the terminal window |
586 let lines =<< trim END | 586 let lines =<< trim END |
587 set foldmethod=marker | |
588 call setline(1, range(100)) | |
589 for nr in range(7) | |
590 call setline(nr * 12 + 1, "fold {{{") | |
591 call setline(nr * 12 + 11 , "end }}}") | |
592 endfor | |
593 %foldclose | |
587 set shell=/bin/sh noruler | 594 set shell=/bin/sh noruler |
588 let $PS1 = 'vim> ' | 595 let $PS1 = 'vim> ' |
589 terminal | 596 terminal ++rows=4 |
590 $wincmd w | 597 $wincmd w |
591 let winid = popup_create(['1111', '2222'], #{ | 598 let winid = popup_create(['1111', '2222'], #{ |
592 \ drag: 1, | 599 \ drag: 1, |
593 \ resize: 1, | 600 \ resize: 1, |
594 \ border: [], | 601 \ border: [], |
595 \ line: 3, | 602 \ line: 3, |
596 \ }) | 603 \ }) |
597 func Dragit() | 604 func DragitLeft() |
598 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt") | 605 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt") |
606 endfunc | |
607 func DragitDown() | |
608 call feedkeys("\<F4>\<LeftMouse>\<F5>\<LeftDrag>\<LeftRelease>", "xt") | |
609 endfunc | |
610 func DragitDownLeft() | |
611 call feedkeys("\<F5>\<LeftMouse>\<F6>\<LeftDrag>\<LeftRelease>", "xt") | |
599 endfunc | 612 endfunc |
600 map <silent> <F3> :call test_setmouse(3, &columns / 2)<CR> | 613 map <silent> <F3> :call test_setmouse(3, &columns / 2)<CR> |
601 map <silent> <F4> :call test_setmouse(3, &columns / 2 - 20)<CR> | 614 map <silent> <F4> :call test_setmouse(3, &columns / 2 - 20)<CR> |
615 map <silent> <F5> :call test_setmouse(12, &columns / 2)<CR> | |
616 map <silent> <F6> :call test_setmouse(12, &columns / 2 - 20)<CR> | |
602 END | 617 END |
603 call writefile(lines, 'XtestPopupTerm') | 618 call writefile(lines, 'XtestPopupTerm') |
604 let buf = RunVimInTerminal('-S XtestPopupTerm', #{rows: 10}) | 619 let buf = RunVimInTerminal('-S XtestPopupTerm', #{rows: 16}) |
605 call VerifyScreenDump(buf, 'Test_popupwin_term_01', {}) | 620 call VerifyScreenDump(buf, 'Test_popupwin_term_01', {}) |
606 | 621 |
607 call term_sendkeys(buf, ":call Dragit()\<CR>") | 622 call term_sendkeys(buf, ":call DragitLeft()\<CR>") |
608 call VerifyScreenDump(buf, 'Test_popupwin_term_02', {}) | 623 call VerifyScreenDump(buf, 'Test_popupwin_term_02', {}) |
624 | |
625 call term_sendkeys(buf, ":call DragitDown()\<CR>") | |
626 call VerifyScreenDump(buf, 'Test_popupwin_term_03', {}) | |
627 | |
628 call term_sendkeys(buf, ":call DragitDownLeft()\<CR>") | |
629 call VerifyScreenDump(buf, 'Test_popupwin_term_04', {}) | |
609 | 630 |
610 " clean up | 631 " clean up |
611 call StopVimInTerminal(buf) | 632 call StopVimInTerminal(buf) |
612 call delete('XtestPopupTerm') | 633 call delete('XtestPopupTerm') |
613 endfunc | 634 endfunc |