1
0
forked from aniani/vim

patch 8.2.5038: a finished terminal in a popup window does not show scrollbar

Problem:    A finished terminal in a popup window does not show a scrollbar.
Solution:   Show the scrollbar if the terminal job is finished. (closes
            #10497)
This commit is contained in:
Bram Moolenaar
2022-05-29 14:13:04 +01:00
parent 4d97a565ae
commit d28950f954
6 changed files with 108 additions and 10 deletions

View File

@@ -0,0 +1,15 @@
| +0&#ffffff0@74
|~+0#4040ff13&| @73
|~| @14|╔+0#0000001#ffd7ff255|═@40|╗| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4|2| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4|3| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4@1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4|5| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|4|8| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255>4|9| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@15
|~| @73
|~| @73
| +0#0000000&@56|5|0|,|1| @9|B|o|t|

View File

@@ -0,0 +1,15 @@
| +0&#ffffff0@74
|~+0#4040ff13&| @73
|~| @14|╔+0#0000001#ffd7ff255|═@40|╗| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2|1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2@1| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2|3| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255>2|4| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2|5| @37| +0#0000000#0000001|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2|6| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2|7| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|║+0#0000001#ffd7ff255|2|8| @37| +0#0000000#a8a8a8255|║+0#0000001#ffd7ff255| +0#4040ff13#ffffff0@15
|~| @14|╚+0#0000001#ffd7ff255|═@40|╝| +0#4040ff13#ffffff0@15
|~| @73
|~| @73
| +0#0000000&@56|2|5|,|1| @9|5|0|%|

View File

@@ -0,0 +1,15 @@
> +0&#ffffff0@74
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|:+0#0000000&|q| @54|0|,|0|-|1| @8|A|l@1|

View File

@@ -2856,7 +2856,7 @@ func Test_popupwin_terminal_buffer()
call assert_fails('call popup_create(termbuf2, #{})', 'E861:')
call term_sendkeys(termbuf2, "exit\<CR>")
" Exiting shell closes popup window
" Exiting shell puts popup window in Terminal-Normal mode.
call feedkeys("exit\<CR>", 'xt')
" Wait for shell to exit
call WaitForAssert({-> assert_equal("dead", job_status(term_getjob(termbuf)))})
@@ -2866,6 +2866,42 @@ func Test_popupwin_terminal_buffer()
call assert_equal(origwin, win_getid())
endfunc
func Test_popupwin_terminal_scrollbar()
CheckFeature terminal
CheckScreendump
CheckUnix
call writefile(range(50), 'Xtestfile')
let lines =<< trim END
vim9script
term_start(['cat', 'Xtestfile'], {hidden: true})
->popup_create({
minwidth: 40,
maxwidth: 40,
minheight: 8,
maxheight: 8,
scrollbar: true,
border: []
})
END
call writefile(lines, 'Xpterm')
let buf = RunVimInTerminal('-S Xpterm', #{rows: 15})
call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_1', {})
" scroll to the middle
call term_sendkeys(buf, "50%")
call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_2', {})
" close the popupwin.
call term_sendkeys(buf, ":q\<CR>")
call VerifyScreenDump(buf, 'Test_popupwin_poptermscroll_3', {})
call StopVimInTerminal(buf)
call delete('Xtestfile')
call delete('Xpterm')
endfunc
func Test_popupwin_close_prevwin()
CheckFeature terminal
call Popupwin_close_prevwin()