comparison src/testdir/test_popupwin.vim @ 17069:76ae212a9075 v8.1.1534

patch 8.1.1534: modeless selection in popup window selects too much commit https://github.com/vim/vim/commit/bd75b5333d10e63f7a667d4b65e80d309435629e Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 14 23:41:55 2019 +0200 patch 8.1.1534: modeless selection in popup window selects too much Problem: Modeless selection in popup window selects too much. Solution: Restrict the selection to insde of the popup window.
author Bram Moolenaar <Bram@vim.org>
date Fri, 14 Jun 2019 23:45:06 +0200
parents f4de7ccdfd8c
children 57125309eef3
comparison
equal deleted inserted replaced
17068:70b81915f7f7 17069:76ae212a9075
315 call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {}) 315 call VerifyScreenDump(buf, 'Test_popupwin_drag_02', {})
316 316
317 " clean up 317 " clean up
318 call StopVimInTerminal(buf) 318 call StopVimInTerminal(buf)
319 call delete('XtestPopupDrag') 319 call delete('XtestPopupDrag')
320 endfunc
321
322 func Test_popup_select()
323 if !CanRunVimInTerminal()
324 throw 'Skipped: cannot make screendumps'
325 endif
326 " create a popup with some text to be selected
327 let lines =<< trim END
328 call setline(1, range(1, 20))
329 let winid = popup_create(['the word', 'some more', 'several words here'], {
330 \ 'drag': 1,
331 \ 'border': [],
332 \ 'line': 3,
333 \ 'col': 10,
334 \ })
335 func Select1()
336 call feedkeys("\<F3>\<LeftMouse>\<F4>\<LeftDrag>\<LeftRelease>", "xt")
337 endfunc
338 map <silent> <F3> :call test_setmouse(4, 15)<CR>
339 map <silent> <F4> :call test_setmouse(6, 23)<CR>
340 END
341 call writefile(lines, 'XtestPopupSelect')
342 let buf = RunVimInTerminal('-S XtestPopupSelect', {'rows': 10})
343 call term_sendkeys(buf, ":call Select1()\<CR>")
344 call VerifyScreenDump(buf, 'Test_popupwin_select_01', {})
345
346 call term_sendkeys(buf, ":call popup_close(winid)\<CR>")
347 call term_sendkeys(buf, "\"*p")
348 call VerifyScreenDump(buf, 'Test_popupwin_select_02', {})
349
350 " clean up
351 call StopVimInTerminal(buf)
352 call delete('XtestPopupSelect')
320 endfunc 353 endfunc
321 354
322 func Test_popup_in_tab() 355 func Test_popup_in_tab()
323 " default popup is local to tab, not visible when in other tab 356 " default popup is local to tab, not visible when in other tab
324 let winid = popup_create("text", {}) 357 let winid = popup_create("text", {})