From 52a2f0f1da4e554a81beb45211a9d09afffde595 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 15:16:56 +0100 Subject: [PATCH 01/10] patch 8.0.1258: 'ttymouse' is set to "sgr" even though it's not supported Problem: 'ttymouse' is set to "sgr" even though it's not supported. (Gary Johnson) Solution: Adjust #ifdef --- src/term.c | 38 ++++++++++++++++++++++---------------- src/version.c | 2 ++ 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/term.c b/src/term.c index 8df5e02ec7..977987c2b3 100644 --- a/src/term.c +++ b/src/term.c @@ -4547,22 +4547,6 @@ check_termcode( { int need_flush = FALSE; - /* Only set 'ttymouse' automatically if it was not set - * by the user already. */ - if (!option_was_set((char_u *)"ttym")) - { -# ifdef TTYM_SGR - if (version >= 277) - set_option_value((char_u *)"ttym", 0L, - (char_u *)"sgr", 0); - else -# endif - /* if xterm version >= 95 use mouse dragging */ - if (version >= 95) - set_option_value((char_u *)"ttym", 0L, - (char_u *)"xterm2", 0); - } - /* if xterm version >= 141 try to get termcap codes */ if (version >= 141) { @@ -4581,6 +4565,28 @@ check_termcode( * 256, libvterm supports even more. */ if (mch_getenv((char_u *)"COLORS") == NULL) may_adjust_color_count(256); +# ifdef FEAT_MOUSE_SGR + /* Libvterm can handle SGR mouse reporting. */ + if (!option_was_set((char_u *)"ttym")) + set_option_value((char_u *)"ttym", 0L, + (char_u *)"sgr", 0); +# endif + } + + /* Only set 'ttymouse' automatically if it was not set + * by the user already. */ + if (!option_was_set((char_u *)"ttym")) + { +# ifdef FEAT_MOUSE_SGR + if (version >= 277) + set_option_value((char_u *)"ttym", 0L, + (char_u *)"sgr", 0); + else +# endif + /* if xterm version >= 95 use mouse dragging */ + if (version >= 95) + set_option_value((char_u *)"ttym", 0L, + (char_u *)"xterm2", 0); } /* Detect terminals that set $TERM to something like diff --git a/src/version.c b/src/version.c index 65f5a4b03a..f28132cf9a 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1258, /**/ 1257, /**/ From 13deab8d08145c1f6e2a3e82cb547bc7f87a3686 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 18:48:43 +0100 Subject: [PATCH 02/10] patch 8.0.1259: search test can be flaky Problem: Search test can be flaky. Solution: Use WaitFor() instead of a delay. Make it possible to pass a funcref to WaitFor() to avoid the need for global variables. (James McCoy, closes #2282) --- src/testdir/shared.vim | 11 ++++- src/testdir/test_search.vim | 86 ++++++++++++++++++------------------- src/version.c | 2 + 3 files changed, 52 insertions(+), 47 deletions(-) diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim index d6033d5811..8042428cf4 100644 --- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -113,7 +113,9 @@ func s:kill_server(cmd) endif endfunc -" Wait for up to a second for "expr" to become true. +" Wait for up to a second for "expr" to become true. "expr" can be a +" stringified expression to evaluate, or a funcref without arguments. +" " Return time slept in milliseconds. With the +reltime feature this can be " more than the actual waiting time. Without +reltime it can also be less. func WaitFor(expr, ...) @@ -124,8 +126,13 @@ func WaitFor(expr, ...) else let slept = 0 endif + if type(a:expr) == v:t_func + let Test = a:expr + else + let Test = {-> eval(a:expr) } + endif for i in range(timeout / 10) - if eval(a:expr) + if Test() if has('reltime') return float2nr(reltimefloat(reltime(start)) * 1000) endif diff --git a/src/testdir/test_search.vim b/src/testdir/test_search.vim index 37661c31ae..986b8bc780 100644 --- a/src/testdir/test_search.vim +++ b/src/testdir/test_search.vim @@ -482,19 +482,17 @@ func Test_search_cmdline8() " Prepare buffer text let lines = ['abb vim vim vi', 'vimvivim'] call writefile(lines, 'Xsearch.txt') - let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 'Xsearch.txt'], {'term_rows': 3}) + let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 'Xsearch.txt'], {'term_rows': 3}) - call term_wait(g:buf, 200) - call assert_equal(lines[0], term_getline(g:buf, 1)) - call assert_equal(lines[1], term_getline(g:buf, 2)) + call WaitFor({-> lines == [term_getline(buf, 1), term_getline(buf, 2)] }) - call term_sendkeys(g:buf, ":set incsearch hlsearch\") - call term_sendkeys(g:buf, ":14vsp\") - call term_sendkeys(g:buf, "/vim\") - call term_sendkeys(g:buf, "/b\") - call term_sendkeys(g:buf, "gg0") - call term_wait(g:buf, 500) - let screen_line = term_scrape(g:buf, 1) + call term_sendkeys(buf, ":set incsearch hlsearch\") + call term_sendkeys(buf, ":14vsp\") + call term_sendkeys(buf, "/vim\") + call term_sendkeys(buf, "/b\") + call term_sendkeys(buf, "gg0") + call term_wait(buf, 500) + let screen_line = term_scrape(buf, 1) let [a0,a1,a2,a3] = [screen_line[3].attr, screen_line[4].attr, \ screen_line[18].attr, screen_line[19].attr] call assert_notequal(a0, a1) @@ -607,19 +605,17 @@ func Test_search_cmdline_incsearch_highlight_attr() endif " Prepare buffer text - let g:lines = ['abb vim vim vi', 'vimvivim'] - call writefile(g:lines, 'Xsearch.txt') - let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 'Xsearch.txt'], {'term_rows': 3}) - call WaitFor('g:lines[0] == term_getline(g:buf, 1)') - call assert_equal(g:lines[0], term_getline(g:buf, 1)) - call assert_equal(g:lines[1], term_getline(g:buf, 2)) - unlet g:lines + let lines = ['abb vim vim vi', 'vimvivim'] + call writefile(lines, 'Xsearch.txt') + let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile', 'Xsearch.txt'], {'term_rows': 3}) + + call WaitFor({-> lines == [term_getline(buf, 1), term_getline(buf, 2)] }) " Get attr of normal(a0), incsearch(a1), hlsearch(a2) highlight - call term_sendkeys(g:buf, ":set incsearch hlsearch\") - call term_sendkeys(g:buf, '/b') - call term_wait(g:buf, 200) - let screen_line1 = term_scrape(g:buf, 1) + call term_sendkeys(buf, ":set incsearch hlsearch\") + call term_sendkeys(buf, '/b') + call term_wait(buf, 200) + let screen_line1 = term_scrape(buf, 1) call assert_true(len(screen_line1) > 2) " a0: attr_normal let a0 = screen_line1[0].attr @@ -630,53 +626,53 @@ func Test_search_cmdline_incsearch_highlight_attr() call assert_notequal(a0, a1) call assert_notequal(a0, a2) call assert_notequal(a1, a2) - call term_sendkeys(g:buf, "\gg0") + call term_sendkeys(buf, "\gg0") " Test incremental highlight search - call term_sendkeys(g:buf, "/vim") - call term_wait(g:buf, 200) + call term_sendkeys(buf, "/vim") + call term_wait(buf, 200) " Buffer: " abb vim vim vi " vimvivim " Search: /vim let attr_line1 = [a0,a0,a0,a0,a1,a1,a1,a0,a2,a2,a2,a0,a0,a0] let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] - call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr')) - call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr')) + call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) + call assert_equal(attr_line2, map(term_scrape(buf, 2)[:len(attr_line2)-1], 'v:val.attr')) " Test - call term_sendkeys(g:buf, "\\") - call term_wait(g:buf, 200) + call term_sendkeys(buf, "\\") + call term_wait(buf, 200) let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0] let attr_line2 = [a1,a1,a1,a0,a0,a2,a2,a2] - call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr')) - call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr')) + call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) + call assert_equal(attr_line2, map(term_scrape(buf, 2)[:len(attr_line2)-1], 'v:val.attr')) " Test - call term_sendkeys(g:buf, "\") - call term_wait(g:buf, 200) + call term_sendkeys(buf, "\") + call term_wait(buf, 200) let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a1,a1,a1,a0,a0,a0] let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] - call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr')) - call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr')) + call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) + call assert_equal(attr_line2, map(term_scrape(buf, 2)[:len(attr_line2)-1], 'v:val.attr')) " Type Enter and a1(incsearch highlight) should become a2(hlsearch highlight) - call term_sendkeys(g:buf, "\") - call term_wait(g:buf, 200) + call term_sendkeys(buf, "\") + call term_wait(buf, 200) let attr_line1 = [a0,a0,a0,a0,a2,a2,a2,a0,a2,a2,a2,a0,a0,a0] let attr_line2 = [a2,a2,a2,a0,a0,a2,a2,a2] - call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr')) - call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr')) + call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) + call assert_equal(attr_line2, map(term_scrape(buf, 2)[:len(attr_line2)-1], 'v:val.attr')) " Test nohlsearch. a2(hlsearch highlight) should become a0(normal highlight) - call term_sendkeys(g:buf, ":1\") - call term_sendkeys(g:buf, ":set nohlsearch\") - call term_sendkeys(g:buf, "/vim") - call term_wait(g:buf, 200) + call term_sendkeys(buf, ":1\") + call term_sendkeys(buf, ":set nohlsearch\") + call term_sendkeys(buf, "/vim") + call term_wait(buf, 200) let attr_line1 = [a0,a0,a0,a0,a1,a1,a1,a0,a0,a0,a0,a0,a0,a0] let attr_line2 = [a0,a0,a0,a0,a0,a0,a0,a0] - call assert_equal(attr_line1, map(term_scrape(g:buf, 1)[:len(attr_line1)-1], 'v:val.attr')) - call assert_equal(attr_line2, map(term_scrape(g:buf, 2)[:len(attr_line2)-1], 'v:val.attr')) + call assert_equal(attr_line1, map(term_scrape(buf, 1)[:len(attr_line1)-1], 'v:val.attr')) + call assert_equal(attr_line2, map(term_scrape(buf, 2)[:len(attr_line2)-1], 'v:val.attr')) call delete('Xsearch.txt') call delete('Xsearch.txt') diff --git a/src/version.c b/src/version.c index f28132cf9a..e31f17b2bc 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1259, /**/ 1258, /**/ From ab8b1c14a31e36ae87cc7e13c4a75318d513fc7b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 19:24:31 +0100 Subject: [PATCH 03/10] patch 8.0.1260: using global variables for WaitFor() Problem: Using global variables for WaitFor(). Solution: Use a lambda function instead. Don't check a condition if WaitFor() already checked it. --- src/testdir/test_channel.vim | 6 +--- src/testdir/test_clientserver.vim | 23 ++++++------ src/testdir/test_job_fails.vim | 9 ++--- src/testdir/test_popup.vim | 28 +++++++-------- src/testdir/test_quotestar.vim | 21 ++++++----- src/testdir/test_terminal.vim | 59 ++++++++++++++----------------- src/version.c | 2 ++ 7 files changed, 68 insertions(+), 80 deletions(-) diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim index 5709bf8325..459ee13fa7 100644 --- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -274,12 +274,10 @@ func Ch_channel_handler(port) " Test that it works while waiting on a numbered message. call assert_equal('ok', ch_evalexpr(handle, 'call me')) call WaitFor('"we called you" == g:Ch_reply') - call assert_equal('we called you', g:Ch_reply) " Test that it works while not waiting on a numbered message. call ch_sendexpr(handle, 'call me again') call WaitFor('"we did call you" == g:Ch_reply') - call assert_equal('we did call you', g:Ch_reply) endfunc func Test_channel_handler() @@ -322,7 +320,6 @@ func Ch_channel_zero(port) call assert_equal('sent zero', ch_evalexpr(handle, 'send zero')) if s:has_handler call WaitFor('"zero index" == g:Ch_reply') - call assert_equal('zero index', g:Ch_reply) else sleep 20m call assert_equal('', g:Ch_reply) @@ -338,7 +335,6 @@ func Ch_channel_zero(port) else call assert_equal('', g:Ch_reply) endif - call assert_equal('sent zero', g:Ch_zero_reply) endfunc func Test_zero_reply() @@ -1468,7 +1464,7 @@ func Test_exit_callback_interval() let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0} let job = job_start([s:python, '-c', 'import time;time.sleep(0.5)'], {'exit_cb': 'MyExitTimeCb'}) let g:exit_cb_val.process = job_info(job).process - call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0') + call WaitFor('type(g:exit_cb_val.end) != v:t_number || g:exit_cb_val.end != 0', 2000) let elapsed = reltimefloat(g:exit_cb_val.end) call assert_true(elapsed > 0.5) call assert_true(elapsed < 1.0) diff --git a/src/testdir/test_clientserver.vim b/src/testdir/test_clientserver.vim index 02840de743..6ef64285e5 100644 --- a/src/testdir/test_clientserver.vim +++ b/src/testdir/test_clientserver.vim @@ -27,12 +27,8 @@ func Test_client_server() let name = 'XVIMTEST' let cmd .= ' --servername ' . name - let g:job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'}) - call WaitFor('job_status(g:job) == "run"') - if job_status(g:job) != 'run' - call assert_report('Cannot run the Vim server') - return - endif + let job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'}) + call WaitFor({-> job_status(job) == "run"}) " Takes a short while for the server to be active. " When using valgrind it takes much longer. @@ -83,7 +79,7 @@ func Test_client_server() call remote_send(name, ":call server2client(expand(''), 'another')\", 'g:myserverid') let peek_result = 'nothing' let r = remote_peek(g:myserverid, 'peek_result') - " unpredictable whether the result is already avaialble. + " unpredictable whether the result is already available. if r > 0 call assert_equal('another', peek_result) elseif r == 0 @@ -97,11 +93,14 @@ func Test_client_server() call assert_equal('another', remote_read(g:myserverid, 2)) call remote_send(name, ":qa!\") - call WaitFor('job_status(g:job) == "dead"') - if job_status(g:job) != 'dead' - call assert_report('Server did not exit') - call job_stop(g:job, 'kill') - endif + try + call WaitFor({-> job_status(job) == "dead"}) + finally + if job_status(job) != 'dead' + call assert_report('Server did not exit') + call job_stop(job, 'kill') + endif + endtry endfunc " Uncomment this line to get a debugging log diff --git a/src/testdir/test_job_fails.vim b/src/testdir/test_job_fails.vim index ddab6a3160..22637c0098 100644 --- a/src/testdir/test_job_fails.vim +++ b/src/testdir/test_job_fails.vim @@ -6,14 +6,11 @@ source shared.vim func Test_job_start_fails() if has('job') - let g:job = job_start('axdfxsdf') + let job = job_start('axdfxsdf') if has('unix') - call WaitFor('job_status(g:job) == "dead"') - call assert_equal('dead', job_status(g:job)) + call WaitFor({-> job_status(job) == "dead"}) else - call WaitFor('job_status(g:job) == "fail"') - call assert_equal('fail', job_status(g:job)) + call WaitFor({-> job_status(job) == "fail"}) endif - unlet g:job endif endfunc diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 281836cec6..54d641fdee 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -638,30 +638,30 @@ func Test_popup_and_window_resize() return endif let rows = h / 3 - let g:buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': rows}) - call term_sendkeys(g:buf, (h / 3 - 1) . "o\") + let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': rows}) + call term_sendkeys(buf, (h / 3 - 1) . "o\") " Wait for the nested Vim to exit insert mode, where it will show the ruler. " Need to trigger a redraw. - call WaitFor(printf('execute("redraw") == "" && term_getline(g:buf, %d) =~ "\\<%d,.*Bot"', rows, rows)) + call WaitFor({-> execute("redraw") == "" && term_getline(buf, rows) =~ '\<' . rows . ',.*Bot'}) - call term_sendkeys(g:buf, "Gi\") - call term_sendkeys(g:buf, "\") - call term_wait(g:buf, 100) + call term_sendkeys(buf, "Gi\") + call term_sendkeys(buf, "\") + call term_wait(buf, 100) " popup first entry "!" must be at the top - call WaitFor('term_getline(g:buf, 1) =~ "^!"') - call assert_match('^!\s*$', term_getline(g:buf, 1)) + call WaitFor({-> term_getline(buf, 1) =~ "^!"}) + call assert_match('^!\s*$', term_getline(buf, 1)) exe 'resize +' . (h - 1) - call term_wait(g:buf, 100) + call term_wait(buf, 100) redraw! " popup shifted down, first line is now empty - call WaitFor('term_getline(g:buf, 1) == ""') - call assert_equal('', term_getline(g:buf, 1)) + call WaitFor({-> term_getline(buf, 1) == ""}) + call assert_equal('', term_getline(buf, 1)) sleep 100m " popup is below cursor line and shows first match "!" - call WaitFor('term_getline(g:buf, term_getcursor(g:buf)[0] + 1) =~ "^!"') - call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0] + 1)) + call WaitFor({-> term_getline(buf, term_getcursor(buf)[0] + 1) =~ "^!"}) + call assert_match('^!\s*$', term_getline(buf, term_getcursor(buf)[0] + 1)) " cursor line also shows ! - call assert_match('^!\s*$', term_getline(g:buf, term_getcursor(g:buf)[0])) + call assert_match('^!\s*$', term_getline(buf, term_getcursor(buf)[0])) bwipe! endfunc diff --git a/src/testdir/test_quotestar.vim b/src/testdir/test_quotestar.vim index b7d31583d4..cc975bed75 100644 --- a/src/testdir/test_quotestar.vim +++ b/src/testdir/test_quotestar.vim @@ -60,12 +60,8 @@ func Do_test_quotestar_for_x11() call assert_notmatch(name, serverlist()) let cmd .= ' --servername ' . name - let g:job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'}) - call WaitFor('job_status(g:job) == "run"') - if job_status(g:job) != 'run' - call assert_report('Cannot run the Vim server') - return '' - endif + let job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'}) + call WaitFor({-> job_status(job) == "run"}) " Takes a short while for the server to be active. call WaitFor('serverlist() =~ "' . name . '"') @@ -124,11 +120,14 @@ func Do_test_quotestar_for_x11() endif call remote_send(name, ":qa!\") - call WaitFor('job_status(g:job) == "dead"') - if job_status(g:job) != 'dead' - call assert_report('Server did not exit') - call job_stop(g:job, 'kill') - endif + try + call WaitFor({-> job_status(job) == "dead"}) + finally + if job_status(job) != 'dead' + call assert_report('Server did not exit') + call job_stop(job, 'kill') + endif + endtry return '' endfunc diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 967cd8fc42..4d20794eac 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -189,15 +189,14 @@ func Test_terminal_scrape_123() call term_wait(1234) call term_wait(buf) - let g:buf = buf " On MS-Windows we first get a startup message of two lines, wait for the " "cls" to happen, after that we have one line with three characters. - call WaitFor('len(term_scrape(g:buf, 1)) == 3') + call WaitFor({-> len(term_scrape(buf, 1)) == 3}) call Check_123(buf) " Must still work after the job ended. - let g:job = term_getjob(buf) - call WaitFor('job_status(g:job) == "dead"') + let job = term_getjob(buf) + call WaitFor({-> job_status(job) == "dead"}) call term_wait(buf) call Check_123(buf) @@ -213,17 +212,17 @@ func Test_terminal_scrape_multibyte() if has('win32') " Run cmd with UTF-8 codepage to make the type command print the expected " multibyte characters. - let g:buf = term_start("cmd /K chcp 65001") - call term_sendkeys(g:buf, "type Xtext\") - call term_sendkeys(g:buf, "exit\") - let g:line = 4 + let buf = term_start("cmd /K chcp 65001") + call term_sendkeys(buf, "type Xtext\") + call term_sendkeys(buf, "exit\") + let line = 4 else - let g:buf = term_start("cat Xtext") - let g:line = 1 + let buf = term_start("cat Xtext") + let line = 1 endif - call WaitFor('len(term_scrape(g:buf, g:line)) >= 7 && term_scrape(g:buf, g:line)[0].chars == "l"') - let l = term_scrape(g:buf, g:line) + call WaitFor({-> len(term_scrape(buf, line)) >= 7 && term_scrape(buf, line)[0].chars == "l"}) + let l = term_scrape(buf, line) call assert_true(len(l) >= 7) call assert_equal('l', l[0].chars) call assert_equal('é', l[1].chars) @@ -235,13 +234,11 @@ func Test_terminal_scrape_multibyte() call assert_equal('r', l[5].chars) call assert_equal('s', l[6].chars) - let g:job = term_getjob(g:buf) - call WaitFor('job_status(g:job) == "dead"') - call term_wait(g:buf) + let job = term_getjob(buf) + call WaitFor({-> job_status(job) == "dead"}) + call term_wait(buf) - exe g:buf . 'bwipe' - unlet g:buf - unlet g:line + exe buf . 'bwipe' call delete('Xtext') endfunc @@ -254,8 +251,8 @@ func Test_terminal_scroll() endif let buf = term_start(cmd) - let g:job = term_getjob(buf) - call WaitFor('job_status(g:job) == "dead"') + let job = term_getjob(buf) + call WaitFor({-> job_status(job) == "dead"}) call term_wait(buf) if has('win32') " TODO: this should not be needed @@ -483,7 +480,7 @@ func Test_terminal_list_args() endfunction func Test_terminal_noblock() - let g:buf = term_start(&shell) + let buf = term_start(&shell) if has('mac') " The shell or something else has a problem dealing with more than 1000 " characters at the same time. @@ -493,26 +490,24 @@ func Test_terminal_noblock() endif for c in ['a','b','c','d','e','f','g','h','i','j','k'] - call term_sendkeys(g:buf, 'echo ' . repeat(c, len) . "\") + call term_sendkeys(buf, 'echo ' . repeat(c, len) . "\") endfor - call term_sendkeys(g:buf, "echo done\") + call term_sendkeys(buf, "echo done\") " On MS-Windows there is an extra empty line below "done". Find "done" in " the last-but-one or the last-but-two line. - let g:lnum = term_getsize(g:buf)[0] - 1 - call WaitFor('term_getline(g:buf, g:lnum) =~ "done" || term_getline(g:buf, g:lnum - 1) =~ "done"', 3000) - let line = term_getline(g:buf, g:lnum) + let lnum = term_getsize(buf)[0] - 1 + call WaitFor({-> term_getline(buf, lnum) =~ "done" || term_getline(buf, lnum - 1) =~ "done"}, 3000) + let line = term_getline(buf, lnum) if line !~ 'done' - let line = term_getline(g:buf, g:lnum - 1) + let line = term_getline(buf, lnum - 1) endif call assert_match('done', line) - let g:job = term_getjob(g:buf) - call Stop_shell_in_terminal(g:buf) - call term_wait(g:buf) - unlet g:buf + let g:job = term_getjob(buf) + call Stop_shell_in_terminal(buf) + call term_wait(buf) unlet g:job - unlet g:lnum bwipe endfunc diff --git a/src/version.c b/src/version.c index e31f17b2bc..4fa6ea5788 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1260, /**/ 1259, /**/ From 1232624ae5b56c167c5982a2620f736c4bbc19ef Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 20:12:14 +0100 Subject: [PATCH 04/10] patch 8.0.1261: program in terminal window gets NL instead of CR Problem: Program in terminal window gets NL instead of CR. (Lifepillar) Solution: Check the tty setup more often. (closes #1998) --- src/terminal.c | 47 +++++++++++++++++++++++++---------------------- src/version.c | 2 ++ 2 files changed, 27 insertions(+), 22 deletions(-) diff --git a/src/terminal.c b/src/terminal.c index 25c7d66cb9..c6b3860d36 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -38,6 +38,8 @@ * in tl_scrollback are no longer used. * * TODO: + * - Termdebug: issue #2154 might be avoided by adding -quiet to gdb? + * patch by Christian, 2017 Oct 23. * - in GUI vertical split causes problems. Cursor is flickering. (Hirohito * Higashi, 2017 Sep 19) * - double click in Window toolbar starts Visual mode (but not always?). @@ -51,8 +53,6 @@ * Also: #2223 * - implement term_setsize() * - Termdebug does not work when Vim build with mzscheme. gdb hangs. - * - Termdebug: issue #2154 might be avoided by adding -quiet to gdb? - * patch by Christian, 2017 Oct 23. * - MS-Windows GUI: WinBar has tearoff item * - MS-Windows GUI: still need to type a key after shell exits? #1924 * - What to store in a session file? Shell at the prompt would be OK to @@ -1535,6 +1535,9 @@ terminal_loop(int blocking) int c; int termkey = 0; int ret; +#ifdef UNIX + int tty_fd = curbuf->b_term->tl_job->jv_channel->ch_part[get_tty_part(curbuf->b_term)].ch_fd; +#endif /* Remember the terminal we are sending keys to. However, the terminal * might be closed while waiting for a character, e.g. typing "exit" in a @@ -1547,26 +1550,6 @@ terminal_loop(int blocking) position_cursor(curwin, &curbuf->b_term->tl_cursor_pos); may_set_cursor_props(curbuf->b_term); -#ifdef UNIX - { - int part = get_tty_part(curbuf->b_term); - int fd = curbuf->b_term->tl_job->jv_channel->ch_part[part].ch_fd; - - if (isatty(fd)) - { - ttyinfo_T info; - - /* Get the current backspace and enter characters of the pty. */ - if (get_tty_info(fd, &info) == OK) - { - term_backspace_char = info.backspace; - term_enter_char = info.enter; - term_nl_does_cr = info.nl_does_cr; - } - } - } -#endif - while (blocking || vpeekc() != NUL) { /* TODO: skip screen update when handling a sequence of keys. */ @@ -1576,6 +1559,26 @@ terminal_loop(int blocking) break; update_cursor(curbuf->b_term, FALSE); +#ifdef UNIX + /* + * The shell or another program may change the tty settings. Getting + * them for every typed character is a bit of overhead, but it's needed + * for the first CR typed, e.g. when Vim starts in a shell. + */ + if (isatty(tty_fd)) + { + ttyinfo_T info; + + /* Get the current backspace and enter characters of the pty. */ + if (get_tty_info(tty_fd, &info) == OK) + { + term_backspace_char = info.backspace; + term_enter_char = info.enter; + term_nl_does_cr = info.nl_does_cr; + } + } +#endif + c = term_vgetc(); if (!term_use_loop()) /* job finished while waiting for a character */ diff --git a/src/version.c b/src/version.c index 4fa6ea5788..7d049d08f2 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1261, /**/ 1260, /**/ From 7dd88c5133feda7e9ccfedcb38b6dfdba459d507 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 20:46:40 +0100 Subject: [PATCH 05/10] patch 8.0.1262: terminal redir test is flaky Problem: Terminal redir test is flaky. Solution: Add it to the list of flaky tests. --- src/testdir/runtest.vim | 1 + src/version.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index a35944830a..08c0e684bf 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -252,6 +252,7 @@ let s:flaky = [ \ 'Test_reltime()', \ 'Test_terminal_composing_unicode()', \ 'Test_terminal_noblock()', + \ 'Test_terminal_redir_file()', \ 'Test_with_partial_callback()', \ ] diff --git a/src/version.c b/src/version.c index 7d049d08f2..b7cb58be4a 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1262, /**/ 1261, /**/ From 5a73e0ca54c77e067c3b12ea6f35e3e8681e8cf8 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 21:35:01 +0100 Subject: [PATCH 06/10] patch 8.0.1263: others can read the swap file if a user is careless Problem: Others can read the swap file if a user is careless with his primary group. Solution: If the group permission allows for reading but the world permissions doesn't, make sure the group is right. --- src/Makefile | 1 + src/fileio.c | 24 +++++++- src/testdir/test_swap.vim | 112 +++++++++++++++++++++++++------------- src/version.c | 2 + 4 files changed, 99 insertions(+), 40 deletions(-) diff --git a/src/Makefile b/src/Makefile index e55e830ef5..48487aad53 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2259,6 +2259,7 @@ test_arglist \ test_stat \ test_statusline \ test_substitute \ + test_swap \ test_syn_attr \ test_syntax \ test_system \ diff --git a/src/fileio.c b/src/fileio.c index 87b85cf386..34dcdb6b59 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -716,7 +716,29 @@ readfile( /* Set swap file protection bits after creating it. */ if (swap_mode > 0 && curbuf->b_ml.ml_mfp != NULL && curbuf->b_ml.ml_mfp->mf_fname != NULL) - (void)mch_setperm(curbuf->b_ml.ml_mfp->mf_fname, (long)swap_mode); + { + char_u *swap_fname = curbuf->b_ml.ml_mfp->mf_fname; + + /* + * If the group-read bit is set but not the world-read bit, then + * the group must be equal to the group of the original file. If + * we can't make that happen then reset the group-read bit. This + * avoids making the swap file readable to more users when the + * primary group of the user is too permissive. + */ + if ((swap_mode & 044) == 040) + { + stat_T swap_st; + + if (mch_stat((char *)swap_fname, &swap_st) >= 0 + && st.st_gid != swap_st.st_gid + && fchown(curbuf->b_ml.ml_mfp->mf_fd, -1, st.st_gid) + == -1) + swap_mode &= 0600; + } + + (void)mch_setperm(swap_fname, (long)swap_mode); + } #endif } diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim index 245e1f18bb..d11c124d0a 100644 --- a/src/testdir/test_swap.vim +++ b/src/testdir/test_swap.vim @@ -1,48 +1,82 @@ " Tests for the swap feature -" Tests for 'directory' option. -func Test_swap_directory() +"" Tests for 'directory' option. +"func Test_swap_directory() +" if !has("unix") +" return +" endif +" let content = ['start of testfile', +" \ 'line 2 Abcdefghij', +" \ 'line 3 Abcdefghij', +" \ 'end of testfile'] +" call writefile(content, 'Xtest1') +" +" " '.', swap file in the same directory as file +" set dir=.,~ +" +" " Verify that the swap file doesn't exist in the current directory +" call assert_equal([], glob(".Xtest1*.swp", 1, 1, 1)) +" edit Xtest1 +" let swfname = split(execute("swapname"))[0] +" call assert_equal([swfname], glob(swfname, 1, 1, 1)) +" +" " './dir', swap file in a directory relative to the file +" set dir=./Xtest2,.,~ +" +" call mkdir("Xtest2") +" edit Xtest1 +" call assert_equal([], glob(swfname, 1, 1, 1)) +" let swfname = "Xtest2/Xtest1.swp" +" call assert_equal(swfname, split(execute("swapname"))[0]) +" call assert_equal([swfname], glob("Xtest2/*", 1, 1, 1)) +" +" " 'dir', swap file in directory relative to the current dir +" set dir=Xtest.je,~ +" +" call mkdir("Xtest.je") +" call writefile(content, 'Xtest2/Xtest3') +" edit Xtest2/Xtest3 +" call assert_equal(["Xtest2/Xtest3"], glob("Xtest2/*", 1, 1, 1)) +" let swfname = "Xtest.je/Xtest3.swp" +" call assert_equal(swfname, split(execute("swapname"))[0]) +" call assert_equal([swfname], glob("Xtest.je/*", 1, 1, 1)) +" +" set dir& +" call delete("Xtest1") +" call delete("Xtest2", "rf") +" call delete("Xtest.je", "rf") +"endfunc + +func Test_swap_group() if !has("unix") return endif - let content = ['start of testfile', - \ 'line 2 Abcdefghij', - \ 'line 3 Abcdefghij', - \ 'end of testfile'] - call writefile(content, 'Xtest1') + let groups = split(system('groups')) + if len(groups) <= 1 + throw 'Skipped: need at least two groups, got ' . groups + endif - " '.', swap file in the same directory as file - set dir=.,~ + call delete('Xtest') + split Xtest + call setline(1, 'just some text') + wq + if system('ls -l Xtest') !~ ' ' . groups[0] . ' \d' + throw 'Skipped: test file does not have the first group' + else + silent !chmod 640 Xtest + call system('chgrp ' . groups[1] . ' Xtest') + if system('ls -l Xtest') !~ ' ' . groups[1] . ' \d' + throw 'Skipped: cannot set second group on test file' + else + split Xtest + let swapname = substitute(execute('swapname'), '[[:space:]]', '', 'g') + call assert_match('Xtest', swapname) + " Group of swapfile must now match original file. + call assert_match(' ' . groups[1] . ' \d', system('ls -l ' . swapname)) - " Verify that the swap file doesn't exist in the current directory - call assert_equal([], glob(".Xtest1*.swp", 1, 1, 1)) - edit Xtest1 - let swfname = split(execute("swapname"))[0] - call assert_equal([swfname], glob(swfname, 1, 1, 1)) + bwipe! + endif + endif - " './dir', swap file in a directory relative to the file - set dir=./Xtest2,.,~ - - call mkdir("Xtest2") - edit Xtest1 - call assert_equal([], glob(swfname, 1, 1, 1)) - let swfname = "Xtest2/Xtest1.swp" - call assert_equal(swfname, split(execute("swapname"))[0]) - call assert_equal([swfname], glob("Xtest2/*", 1, 1, 1)) - - " 'dir', swap file in directory relative to the current dir - set dir=Xtest.je,~ - - call mkdir("Xtest.je") - call writefile(content, 'Xtest2/Xtest3') - edit Xtest2/Xtest3 - call assert_equal(["Xtest2/Xtest3"], glob("Xtest2/*", 1, 1, 1)) - let swfname = "Xtest.je/Xtest3.swp" - call assert_equal(swfname, split(execute("swapname"))[0]) - call assert_equal([swfname], glob("Xtest.je/*", 1, 1, 1)) - - set dir& - call delete("Xtest1") - call delete("Xtest2", "rf") - call delete("Xtest.je", "rf") + call delete('Xtest') endfunc diff --git a/src/version.c b/src/version.c index b7cb58be4a..2a2cefe3d1 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1263, /**/ 1262, /**/ From c3632516303842244442f354734e54a403ec4b50 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 21:44:59 +0100 Subject: [PATCH 07/10] patch 8.0.1264: terminal debugger gets stuck in small window Problem: Terminal debugger gets stuck in small window. Solution: Add "-quiet" to the gdb command. (Christian Brabandt, closes #2154) --- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim index 229cc7a7aa..a4dbf536ae 100644 --- a/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim +++ b/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @@ -80,7 +80,8 @@ func s:StartDebug(cmd) let commpty = job_info(term_getjob(s:commbuf))['tty_out'] " Open a terminal window to run the debugger. - let cmd = [g:termdebugger, '-tty', pty, a:cmd] + " Add -quiet to avoid the intro message causing a hit-enter prompt. + let cmd = [g:termdebugger, '-quiet', '-tty', pty, a:cmd] echomsg 'executing "' . join(cmd) . '"' let gdbbuf = term_start(cmd, { \ 'exit_cb': function('s:EndDebug'), diff --git a/src/version.c b/src/version.c index 2a2cefe3d1..e83549c98e 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1264, /**/ 1263, /**/ From ad7dac85c3c90893e78e5463ca44b874082b482f Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 22:21:21 +0100 Subject: [PATCH 08/10] patch 8.0.1265: swap test not skipped when there is one group Problem: Swap test not skipped when there is one group. Solution: Convert list to string for the message. --- src/testdir/test_swap.vim | 2 +- src/version.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim index d11c124d0a..457edf685a 100644 --- a/src/testdir/test_swap.vim +++ b/src/testdir/test_swap.vim @@ -53,7 +53,7 @@ func Test_swap_group() endif let groups = split(system('groups')) if len(groups) <= 1 - throw 'Skipped: need at least two groups, got ' . groups + throw 'Skipped: need at least two groups, got ' . string(groups) endif call delete('Xtest') diff --git a/src/version.c b/src/version.c index e83549c98e..78b58115d3 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1265, /**/ 1264, /**/ From ffe010fa0363d1a04b15cc6af119a4af63ba9363 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 22:30:40 +0100 Subject: [PATCH 09/10] patch 8.0.1266: Test_swap_directory was commented out Problem: Test_swap_directory was accidentally commented out. Solution: Uncomment the test. --- src/testdir/test_swap.vim | 92 +++++++++++++++++++-------------------- src/version.c | 2 + 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim index 457edf685a..ee11a731b1 100644 --- a/src/testdir/test_swap.vim +++ b/src/testdir/test_swap.vim @@ -1,51 +1,51 @@ " Tests for the swap feature -"" Tests for 'directory' option. -"func Test_swap_directory() -" if !has("unix") -" return -" endif -" let content = ['start of testfile', -" \ 'line 2 Abcdefghij', -" \ 'line 3 Abcdefghij', -" \ 'end of testfile'] -" call writefile(content, 'Xtest1') -" -" " '.', swap file in the same directory as file -" set dir=.,~ -" -" " Verify that the swap file doesn't exist in the current directory -" call assert_equal([], glob(".Xtest1*.swp", 1, 1, 1)) -" edit Xtest1 -" let swfname = split(execute("swapname"))[0] -" call assert_equal([swfname], glob(swfname, 1, 1, 1)) -" -" " './dir', swap file in a directory relative to the file -" set dir=./Xtest2,.,~ -" -" call mkdir("Xtest2") -" edit Xtest1 -" call assert_equal([], glob(swfname, 1, 1, 1)) -" let swfname = "Xtest2/Xtest1.swp" -" call assert_equal(swfname, split(execute("swapname"))[0]) -" call assert_equal([swfname], glob("Xtest2/*", 1, 1, 1)) -" -" " 'dir', swap file in directory relative to the current dir -" set dir=Xtest.je,~ -" -" call mkdir("Xtest.je") -" call writefile(content, 'Xtest2/Xtest3') -" edit Xtest2/Xtest3 -" call assert_equal(["Xtest2/Xtest3"], glob("Xtest2/*", 1, 1, 1)) -" let swfname = "Xtest.je/Xtest3.swp" -" call assert_equal(swfname, split(execute("swapname"))[0]) -" call assert_equal([swfname], glob("Xtest.je/*", 1, 1, 1)) -" -" set dir& -" call delete("Xtest1") -" call delete("Xtest2", "rf") -" call delete("Xtest.je", "rf") -"endfunc +" Tests for 'directory' option. +func Test_swap_directory() + if !has("unix") + return + endif + let content = ['start of testfile', + \ 'line 2 Abcdefghij', + \ 'line 3 Abcdefghij', + \ 'end of testfile'] + call writefile(content, 'Xtest1') + + " '.', swap file in the same directory as file + set dir=.,~ + + " Verify that the swap file doesn't exist in the current directory + call assert_equal([], glob(".Xtest1*.swp", 1, 1, 1)) + edit Xtest1 + let swfname = split(execute("swapname"))[0] + call assert_equal([swfname], glob(swfname, 1, 1, 1)) + + " './dir', swap file in a directory relative to the file + set dir=./Xtest2,.,~ + + call mkdir("Xtest2") + edit Xtest1 + call assert_equal([], glob(swfname, 1, 1, 1)) + let swfname = "Xtest2/Xtest1.swp" + call assert_equal(swfname, split(execute("swapname"))[0]) + call assert_equal([swfname], glob("Xtest2/*", 1, 1, 1)) + + " 'dir', swap file in directory relative to the current dir + set dir=Xtest.je,~ + + call mkdir("Xtest.je") + call writefile(content, 'Xtest2/Xtest3') + edit Xtest2/Xtest3 + call assert_equal(["Xtest2/Xtest3"], glob("Xtest2/*", 1, 1, 1)) + let swfname = "Xtest.je/Xtest3.swp" + call assert_equal(swfname, split(execute("swapname"))[0]) + call assert_equal([swfname], glob("Xtest.je/*", 1, 1, 1)) + + set dir& + call delete("Xtest1") + call delete("Xtest2", "rf") + call delete("Xtest.je", "rf") +endfunc func Test_swap_group() if !has("unix") diff --git a/src/version.c b/src/version.c index 78b58115d3..81f5fc385f 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1266, /**/ 1265, /**/ From 5842a748be8039fd6d267f5557fe391c6c95399d Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Sat, 4 Nov 2017 22:36:53 +0100 Subject: [PATCH 10/10] patch 8.0.1267: Test_swap_group may leave file behind Problem: Test_swap_group may leave file behind. Solution: Add a try/finally. --- src/testdir/test_swap.vim | 42 ++++++++++++++++++++------------------- src/testdir/test_undo.vim | 1 + src/version.c | 2 ++ 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim index ee11a731b1..1c4965ea5f 100644 --- a/src/testdir/test_swap.vim +++ b/src/testdir/test_swap.vim @@ -56,27 +56,29 @@ func Test_swap_group() throw 'Skipped: need at least two groups, got ' . string(groups) endif - call delete('Xtest') - split Xtest - call setline(1, 'just some text') - wq - if system('ls -l Xtest') !~ ' ' . groups[0] . ' \d' - throw 'Skipped: test file does not have the first group' - else - silent !chmod 640 Xtest - call system('chgrp ' . groups[1] . ' Xtest') - if system('ls -l Xtest') !~ ' ' . groups[1] . ' \d' - throw 'Skipped: cannot set second group on test file' + try + call delete('Xtest') + split Xtest + call setline(1, 'just some text') + wq + if system('ls -l Xtest') !~ ' ' . groups[0] . ' \d' + throw 'Skipped: test file does not have the first group' else - split Xtest - let swapname = substitute(execute('swapname'), '[[:space:]]', '', 'g') - call assert_match('Xtest', swapname) - " Group of swapfile must now match original file. - call assert_match(' ' . groups[1] . ' \d', system('ls -l ' . swapname)) + silent !chmod 640 Xtest + call system('chgrp ' . groups[1] . ' Xtest') + if system('ls -l Xtest') !~ ' ' . groups[1] . ' \d' + throw 'Skipped: cannot set second group on test file' + else + split Xtest + let swapname = substitute(execute('swapname'), '[[:space:]]', '', 'g') + call assert_match('Xtest', swapname) + " Group of swapfile must now match original file. + call assert_match(' ' . groups[1] . ' \d', system('ls -l ' . swapname)) - bwipe! + bwipe! + endif endif - endif - - call delete('Xtest') + finally + call delete('Xtest') + endtry endfunc diff --git a/src/testdir/test_undo.vim b/src/testdir/test_undo.vim index bda7a442f1..4ea1c9b69d 100644 --- a/src/testdir/test_undo.vim +++ b/src/testdir/test_undo.vim @@ -190,6 +190,7 @@ func Test_undojoin_redo() endfunc func Test_undo_write() + call delete('Xtest') split Xtest call feedkeys("ione one one\", 'xt') w! diff --git a/src/version.c b/src/version.c index 81f5fc385f..0fb6952d83 100644 --- a/src/version.c +++ b/src/version.c @@ -761,6 +761,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 1267, /**/ 1266, /**/