Mercurial > vim
comparison src/testdir/test_popup.vim @ 23770:385d33dfb7df v8.2.2426
patch 8.2.2426: allowing 'completefunc' to switch windows causes trouble
Commit: https://github.com/vim/vim/commit/28976e2accf11591c60e8a658a9e03544f0408b2
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Jan 29 21:07:07 2021 +0100
patch 8.2.2426: allowing 'completefunc' to switch windows causes trouble
Problem: Allowing 'completefunc' to switch windows causes trouble.
Solution: use "textwinlock" instead of "textlock".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 29 Jan 2021 21:15:04 +0100 |
parents | 8e0ec52cad85 |
children | f5225486d3de |
comparison
equal
deleted
inserted
replaced
23769:3dd5ed701137 | 23770:385d33dfb7df |
---|---|
340 new | 340 new |
341 let winid = win_getid() | 341 let winid = win_getid() |
342 setlocal completefunc=DummyCompleteOne | 342 setlocal completefunc=DummyCompleteOne |
343 call setline(1, 'one') | 343 call setline(1, 'one') |
344 /^one | 344 /^one |
345 call assert_fails('call feedkeys("A\<C-X>\<C-U>\<C-N>\<Esc>", "x")', 'E578:') | 345 call assert_fails('call feedkeys("A\<C-X>\<C-U>\<C-N>\<Esc>", "x")', 'E565:') |
346 call assert_equal(winid, win_getid()) | 346 call assert_equal(winid, win_getid()) |
347 call assert_equal('onedef', getline(1)) | 347 call assert_equal('onedef', getline(1)) |
348 q! | 348 q! |
349 endfunc | 349 endfunc |
350 | 350 |
640 " Calling complete() after complete_add() in 'completefunc' is wrong, but it | 640 " Calling complete() after complete_add() in 'completefunc' is wrong, but it |
641 " should not crash. | 641 " should not crash. |
642 set completefunc=MessComplete | 642 set completefunc=MessComplete |
643 new | 643 new |
644 call setline(1, 'Ju') | 644 call setline(1, 'Ju') |
645 call feedkeys("A\<c-x>\<c-u>/\<esc>", 'tx') | 645 call assert_fails('call feedkeys("A\<c-x>\<c-u>/\<esc>", "tx")', 'E578:') |
646 call assert_equal('Oct/Oct', getline(1)) | 646 call assert_equal('Jan/', getline(1)) |
647 bwipe! | 647 bwipe! |
648 set completefunc= | 648 set completefunc= |
649 endfunc | 649 endfunc |
650 | 650 |
651 func Test_complete_CTRLN_startofbuffer() | 651 func Test_complete_CTRLN_startofbuffer() |