Mercurial > vim
comparison src/testdir/test_popup.vim @ 12736:4ca72d1ed7f0 v8.0.1246
patch 8.0.1246: popup test has an arbitrary delay
commit https://github.com/vim/vim/commit/b315876efa7865486b9cc160d43f0ead47e58d6c
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 2 17:50:14 2017 +0100
patch 8.0.1246: popup test has an arbitrary delay
Problem: Popup test has an arbitrary delay.
Solution: Wait for the ruler to show. (James McCoy)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 02 Nov 2017 18:00:04 +0100 |
parents | 00baa23b7759 |
children | c1347c968d31 |
comparison
equal
deleted
inserted
replaced
12735:32d8f47598b1 | 12736:4ca72d1ed7f0 |
---|---|
635 endif | 635 endif |
636 let h = winheight(0) | 636 let h = winheight(0) |
637 if h < 15 | 637 if h < 15 |
638 return | 638 return |
639 endif | 639 endif |
640 let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': h / 3}) | 640 let rows = h / 3 |
641 call term_sendkeys(g:buf, (h / 3 - 1)."o\<esc>") | 641 let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': rows}) |
642 call term_wait(g:buf, 500) | 642 call term_sendkeys(g:buf, (h / 3 - 1) . "o\<esc>") |
643 " Wait for the nested Vim to exit insert mode, where it will show the ruler. | |
644 " Need to trigger a redraw. | |
645 call WaitFor(printf('execute("redraw") == "" && term_getline(g:buf, %d) =~ "\\<%d,.*Bot"', rows, rows)) | |
646 | |
643 call term_sendkeys(g:buf, "Gi\<c-x>") | 647 call term_sendkeys(g:buf, "Gi\<c-x>") |
644 call term_sendkeys(g:buf, "\<c-v>") | 648 call term_sendkeys(g:buf, "\<c-v>") |
645 call term_wait(g:buf, 100) | 649 call term_wait(g:buf, 100) |
646 " popup first entry "!" must be at the top | 650 " popup first entry "!" must be at the top |
647 call WaitFor('term_getline(g:buf, 1) =~ "^!"') | 651 call WaitFor('term_getline(g:buf, 1) =~ "^!"') |