mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #14126 from janlazo/vim-8.2.2593
vim-patch:8.2.{2593,2594,2595}
This commit is contained in:
commit
9808c8d9dd
@ -387,9 +387,10 @@ static int put_view(
|
|||||||
if (wp->w_alt_fnum) {
|
if (wp->w_alt_fnum) {
|
||||||
buf_T *const alt = buflist_findnr(wp->w_alt_fnum);
|
buf_T *const alt = buflist_findnr(wp->w_alt_fnum);
|
||||||
|
|
||||||
// Set the alternate file.
|
// Set the alternate file if the buffer is listed.
|
||||||
if ((flagp == &ssop_flags) && alt != NULL && alt->b_fname != NULL
|
if ((flagp == &ssop_flags) && alt != NULL && alt->b_fname != NULL
|
||||||
&& *alt->b_fname != NUL
|
&& *alt->b_fname != NUL
|
||||||
|
&& alt->b_p_bl
|
||||||
&& (fputs("balt ", fd) < 0
|
&& (fputs("balt ", fd) < 0
|
||||||
|| ses_fname(fd, alt, flagp, true) == FAIL)) {
|
|| ses_fname(fd, alt, flagp, true) == FAIL)) {
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
@ -331,6 +331,20 @@ func Test_mkview_no_balt()
|
|||||||
%bwipe
|
%bwipe
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_mksession_no_balt()
|
||||||
|
edit Xtestfile1
|
||||||
|
edit Xtestfile2
|
||||||
|
|
||||||
|
bdelete Xtestfile1
|
||||||
|
mksession! Xtestview
|
||||||
|
|
||||||
|
source Xtestview
|
||||||
|
call assert_equal(0, buflisted('Xtestfile1'))
|
||||||
|
|
||||||
|
call delete('Xtestview')
|
||||||
|
%bwipe
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test :mkview with a file argument.
|
" Test :mkview with a file argument.
|
||||||
func Test_mkview_file()
|
func Test_mkview_file()
|
||||||
" Create a view with line number and a fold.
|
" Create a view with line number and a fold.
|
||||||
|
@ -634,6 +634,28 @@ func Test_opt_winminheight_term()
|
|||||||
call delete('Xwinminheight')
|
call delete('Xwinminheight')
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
func Test_opt_winminheight_term_tabs()
|
||||||
|
" See test/functional/legacy/options_spec.lua
|
||||||
|
CheckRunVimInTerminal
|
||||||
|
|
||||||
|
" The tabline should be taken into account.
|
||||||
|
let lines =<< trim END
|
||||||
|
set wmh=0 stal=2
|
||||||
|
split
|
||||||
|
split
|
||||||
|
split
|
||||||
|
split
|
||||||
|
tabnew
|
||||||
|
END
|
||||||
|
call writefile(lines, 'Xwinminheight')
|
||||||
|
let buf = RunVimInTerminal('-S Xwinminheight', #{rows: 11})
|
||||||
|
call term_sendkeys(buf, ":set wmh=1\n")
|
||||||
|
call WaitForAssert({-> assert_match('E36: Not enough room', term_getline(buf, 11))})
|
||||||
|
|
||||||
|
call StopVimInTerminal(buf)
|
||||||
|
call delete('Xwinminheight')
|
||||||
|
endfunc
|
||||||
|
|
||||||
" Test for setting option value containing spaces with isfname+=32
|
" Test for setting option value containing spaces with isfname+=32
|
||||||
func Test_isfname_with_options()
|
func Test_isfname_with_options()
|
||||||
set isfname+=32
|
set isfname+=32
|
||||||
|
@ -5501,8 +5501,8 @@ void win_setminheight(void)
|
|||||||
|
|
||||||
// loop until there is a 'winminheight' that is possible
|
// loop until there is a 'winminheight' that is possible
|
||||||
while (p_wmh > 0) {
|
while (p_wmh > 0) {
|
||||||
const int room = Rows - p_ch - tabline_height();
|
const int room = Rows - p_ch;
|
||||||
const int needed = frame_minheight(topframe, NULL);
|
const int needed = min_rows() - 1; // 1 was added for the cmdline
|
||||||
if (room >= needed) {
|
if (room >= needed) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,20 @@ describe('set', function()
|
|||||||
matches('E36: Not enough room', exc_exec('set wmh=1'))
|
matches('E36: Not enough room', exc_exec('set wmh=1'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('winminheight works with tabline', function()
|
||||||
|
local screen = Screen.new(20, 11)
|
||||||
|
screen:attach()
|
||||||
|
source([[
|
||||||
|
set wmh=0 stal=2
|
||||||
|
split
|
||||||
|
split
|
||||||
|
split
|
||||||
|
split
|
||||||
|
tabnew
|
||||||
|
]])
|
||||||
|
matches('E36: Not enough room', exc_exec('set wmh=1'))
|
||||||
|
end)
|
||||||
|
|
||||||
it('scroll works', function()
|
it('scroll works', function()
|
||||||
local screen = Screen.new(42, 16)
|
local screen = Screen.new(42, 16)
|
||||||
screen:attach()
|
screen:attach()
|
||||||
|
Loading…
Reference in New Issue
Block a user