Skip to content
Myr

Fix `change-preview` reset by `change-preview-window`

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Fix #3770

authored by Junegunn Choi · committed by Junegunn Choi · parent bf18444 · Browse files · 2 files+8 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+8 added−0 removed

  • tests:+7 added−0 removed
  • other:+1 added−0 removed

2 files+8 added−0 removed

modified:src/terminal.go+1 added
4086 unmodified lines
4087 currentPreviewOpts := t.previewOpts40884089 // Reset preview options and apply the additional options4090 t.previewOpts = t.initialPreviewOpts4091 t.previewOpts.command = currentPreviewOpts.command40924093 // Split window options4094 tokens := strings.Split(a.a, "|")4095 if len(tokens[0]) > 0 && t.initialPreviewOpts.hidden {
237 unmodified lines
modified:test/test_go.rb+7 added
2691 unmodified lines
2692 assert_equal ' 3', lines[1]2693 end2694 end26952696 def test_change_preview_window_should_not_reset_change_preview2697 tmux.send_keys "#{FZF} --preview-window up,border-none --bind 'start:change-preview(echo hello)' --bind 'enter:change-preview-window(border-left)'", :Enter2698 tmux.until { |lines| assert_equal 'hello', lines[0] }2699 tmux.send_keys :Enter2700 tmux.until { |lines| assert_equal '│ hello', lines[0] }2701 end27022703 def test_change_preview_window_rotate2704 tmux.send_keys "seq 100 | #{FZF} --preview-window left,border-none --preview 'echo hello' --bind '" \2705 "a:change-preview-window(right|down|up|hidden|)'", :Enter2706 tmux.until { |lines| assert(lines.any? { _1.include?('100/100') }) }
1091 unmodified lines