To: vim_dev@googlegroups.com Subject: Patch 8.2.0862 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0862 Problem: ":term ++curwin" makes the current buffer hidden. (Harm te Hennepe) Solution: Do not hide the current buffer. (closes #6170) Files: src/terminal.c, src/testdir/test_terminal.vim *** ../vim-8.2.0861/src/terminal.c 2020-05-30 20:30:42.896816552 +0200 --- src/terminal.c 2020-05-31 16:04:10.422114904 +0200 *************** *** 459,467 **** return NULL; } if (do_ecmd(0, NULL, NULL, &split_ea, ECMD_ONE, ! ECMD_HIDE ! + ((flags & TERM_START_FORCEIT) ? ECMD_FORCEIT : 0), ! curwin) == FAIL) { vim_free(term); return NULL; --- 459,467 ---- return NULL; } if (do_ecmd(0, NULL, NULL, &split_ea, ECMD_ONE, ! (buf_hide(curwin->w_buffer) ? ECMD_HIDE : 0) ! + ((flags & TERM_START_FORCEIT) ? ECMD_FORCEIT : 0), ! curwin) == FAIL) { vim_free(term); return NULL; *** ../vim-8.2.0861/src/testdir/test_terminal.vim 2020-05-24 17:23:41.838154769 +0200 --- src/testdir/test_terminal.vim 2020-05-31 16:02:41.294448602 +0200 *************** *** 450,466 **** let cmd = Get_cat_123_cmd() call assert_equal(1, winnr('$')) ! split dummy exe 'terminal ++curwin ' . cmd call assert_equal(2, winnr('$')) bwipe! ! split dummy call term_start(cmd, {'curwin': 1}) call assert_equal(2, winnr('$')) bwipe! ! split dummy call setline(1, 'change') call assert_fails('terminal ++curwin ' . cmd, 'E37:') call assert_equal(2, winnr('$')) --- 450,470 ---- let cmd = Get_cat_123_cmd() call assert_equal(1, winnr('$')) ! split Xdummy ! call setline(1, 'dummy') ! write ! call assert_equal(1, getbufinfo('Xdummy')[0].loaded) exe 'terminal ++curwin ' . cmd call assert_equal(2, winnr('$')) + call assert_equal(0, getbufinfo('Xdummy')[0].loaded) bwipe! ! split Xdummy call term_start(cmd, {'curwin': 1}) call assert_equal(2, winnr('$')) bwipe! ! split Xdummy call setline(1, 'change') call assert_fails('terminal ++curwin ' . cmd, 'E37:') call assert_equal(2, winnr('$')) *************** *** 468,482 **** call assert_equal(2, winnr('$')) bwipe! ! split dummy call setline(1, 'change') call assert_fails("call term_start(cmd, {'curwin': 1})", 'E37:') call assert_equal(2, winnr('$')) bwipe! ! split dummy bwipe! call delete('Xtext') endfunc func s:get_sleep_cmd() --- 472,487 ---- call assert_equal(2, winnr('$')) bwipe! ! split Xdummy call setline(1, 'change') call assert_fails("call term_start(cmd, {'curwin': 1})", 'E37:') call assert_equal(2, winnr('$')) bwipe! ! split Xdummy bwipe! call delete('Xtext') + call delete('Xdummy') endfunc func s:get_sleep_cmd() *** ../vim-8.2.0861/src/version.c 2020-05-31 15:41:53.159138610 +0200 --- src/version.c 2020-05-31 16:03:26.182276682 +0200 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 862, /**/ -- hundred-and-one symptoms of being an internet addict: 231. You sprinkle Carpet Fresh on the rugs and put your vacuum cleaner in the front doorway permanently so it always looks like you are actually attempting to do something about that mess that has amassed since you discovered the Internet. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///