Skip to content
Myr

Fix behavior of 'deselect-all' to only deselect matches

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

To make it consistent with select-all and toggle-all. Close #1364

authored by Junegunn Choi · committed by Junegunn Choi · parent 33f89a0 · Browse files · 2 files+14 added−4 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+14 added−4 removed

  • tests:+8 added−2 removed
  • other:+6 added−2 removed

2 files+14 added−4 removed

modified:src/terminal.go+6 added-2 removed
1835 unmodified lines
1836 req(reqList, reqInfo)1837 }1838 case actDeselectAll:1839 if t.multi > 0 {1840 t.selected = make(map[int32]selectedItem)1841 t.version++1840 for i := 0; i < t.merger.Length() && len(t.selected) > 0; i++ {1841 item := t.merger.Get(i).item1842 if _, found := t.selected[item.Index()]; found {1843 t.deselectItem(item)1844 }1845 }1846 req(reqList, reqInfo)1847 }1848 case actToggle:1849 if t.multi > 0 && t.merger.Length() > 0 && toggle() {
301 unmodified lines
modified:test/test_go.rb+8 added-2 removed
863 unmodified lines
864 tmux.send_keys 'C-a'865 tmux.until { |lines| lines[-2].include? '(100)' }866 tmux.send_keys :Tab, :Tab867 tmux.until { |lines| lines[-2].include? '(98)' }868 tmux.send_keys '100'869 tmux.until { |lines| lines.match_count == 1 }870 tmux.send_keys 'C-d'871 tmux.until { |lines| lines[-2].include? '(97)' }872 tmux.send_keys 'C-u'873 tmux.until { |lines| lines.match_count == 100 }874 tmux.send_keys 'C-d'875 tmux.until { |lines| !lines[-2].include? '(' }870 tmux.send_keys :Tab, :Tab876 tmux.send_keys :BTab, :BTab877 tmux.until { |lines| lines[-2].include? '(2)' }878 tmux.send_keys 0879 tmux.until { |lines| lines[-2].include? '10/100' }880 tmux.send_keys 'C-a'881 tmux.until { |lines| lines[-2].include? '(12)' }882 tmux.send_keys :Enter877 assert_equal %w[2 1 10 20 30 40 50 60 70 80 90 100],883 assert_equal %w[1 2 10 20 30 40 50 60 70 80 90 100],884 readonce.split($INPUT_RECORD_SEPARATOR)885 end886887 def test_history
1101 unmodified lines