Fix tcell renderer's pause and resume

This commit is contained in:
Junegunn Choi 2025-02-02 02:22:47 +09:00
parent 32234be7a2
commit 0c61223884
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
3 changed files with 6 additions and 5 deletions

View File

@ -560,7 +560,7 @@ func (r *FullscreenRenderer) GetChar() Event {
func (r *FullscreenRenderer) Pause(clear bool) { func (r *FullscreenRenderer) Pause(clear bool) {
if clear { if clear {
_screen.Fini() r.Close()
} }
} }
@ -572,6 +572,7 @@ func (r *FullscreenRenderer) Resume(clear bool, sigcont bool) {
func (r *FullscreenRenderer) Close() { func (r *FullscreenRenderer) Close() {
_screen.Fini() _screen.Fini()
_screen = nil
} }
func (r *FullscreenRenderer) RefreshWindows(windows []Window) { func (r *FullscreenRenderer) RefreshWindows(windows []Window) {

View File

@ -338,7 +338,7 @@ class TestLayout < TestInteractive
end end
def test_gap def test_gap
tmux.send_keys %(seq 100 | #{FZF} --gap --border --reverse), :Enter tmux.send_keys %(seq 100 | #{FZF} --gap --border rounded --reverse), :Enter
block = <<~BLOCK block = <<~BLOCK
> >
@ -355,7 +355,7 @@ class TestLayout < TestInteractive
end end
def test_gap_2 def test_gap_2
tmux.send_keys %(seq 100 | #{FZF} --gap=2 --gap-line xyz --border --reverse), :Enter tmux.send_keys %(seq 100 | #{FZF} --gap=2 --gap-line xyz --border rounded --reverse), :Enter
block = <<~BLOCK block = <<~BLOCK
> >
@ -799,7 +799,7 @@ class TestLayout < TestInteractive
end end
def test_style_full_adaptive_height def test_style_full_adaptive_height
tmux.send_keys %(seq 1| #{FZF} --style=full --height=~100% --header-lines=1 --info=default), :Enter tmux.send_keys %(seq 1| #{FZF} --style=full:rounded --height=~100% --header-lines=1 --info=default), :Enter
block = <<~BLOCK block = <<~BLOCK

View File

@ -524,7 +524,7 @@ class TestPreview < TestInteractive
end end
def test_alternative_preview_window_opts def test_alternative_preview_window_opts
tmux.send_keys "seq 10 | #{FZF} --preview-window '~5,2,+0,<100000(~0,+100,wrap,noinfo)' --preview 'seq 1000'", :Enter tmux.send_keys "seq 10 | #{FZF} --preview-border rounded --preview-window '~5,2,+0,<100000(~0,+100,wrap,noinfo)' --preview 'seq 1000'", :Enter
tmux.until { |lines| assert_equal 10, lines.match_count } tmux.until { |lines| assert_equal 10, lines.match_count }
tmux.until do |lines| tmux.until do |lines|
assert_equal ['╭────╮', '│ 10 │', '│ 0 │', '│ 10 │', '│ 1 │'], lines.take(5).map(&:strip) assert_equal ['╭────╮', '│ 10 │', '│ 0 │', '│ 10 │', '│ 1 │'], lines.take(5).map(&:strip)