Mercurial > vim
comparison src/testdir/test_execute_func.vim @ 23596:9fa72351c18f v8.2.2340
patch 8.2.2340: win_execute() unexpectedly returns number zero when failing
Commit: https://github.com/vim/vim/commit/37487e16da7877129edee8d11b9b7f5c8df312c6
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 12 22:08:53 2021 +0100
patch 8.2.2340: win_execute() unexpectedly returns number zero when failing
Problem: win_execute() unexpectedly returns number zero when failing.
Solution: Return an empty string. (closes https://github.com/vim/vim/issues/7665)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 12 Jan 2021 22:15:03 +0100 |
parents | 49694eceaa55 |
children | 5f8dd7b3ae41 |
comparison
equal
deleted
inserted
replaced
23595:d9942c46a490 | 23596:9fa72351c18f |
---|---|
87 let otherwin = win_getid() | 87 let otherwin = win_getid() |
88 call setline(1, 'the new window') | 88 call setline(1, 'the new window') |
89 call win_gotoid(thiswin) | 89 call win_gotoid(thiswin) |
90 let line = win_execute(otherwin, 'echo getline(1)') | 90 let line = win_execute(otherwin, 'echo getline(1)') |
91 call assert_match('the new window', line) | 91 call assert_match('the new window', line) |
92 let line = win_execute(134343, 'echo getline(1)') | |
93 call assert_equal('', line) | |
92 | 94 |
93 if has('popupwin') | 95 if has('popupwin') |
94 let popupwin = popup_create('the popup win', {'line': 2, 'col': 3}) | 96 let popupwin = popup_create('the popup win', {'line': 2, 'col': 3}) |
95 redraw | 97 redraw |
96 let line = 'echo getline(1)'->win_execute(popupwin) | 98 let line = 'echo getline(1)'->win_execute(popupwin) |