mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2025-01-24 07:38:36 +00:00
Fix behavior of 'deselect-all' to only deselect matches
To make it consistent with select-all and toggle-all. Close #1364
This commit is contained in:
parent
33f89a08f3
commit
525040238e
@ -1837,8 +1837,12 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
case actDeselectAll:
|
case actDeselectAll:
|
||||||
if t.multi > 0 {
|
if t.multi > 0 {
|
||||||
t.selected = make(map[int32]selectedItem)
|
for i := 0; i < t.merger.Length() && len(t.selected) > 0; i++ {
|
||||||
t.version++
|
item := t.merger.Get(i).item
|
||||||
|
if _, found := t.selected[item.Index()]; found {
|
||||||
|
t.deselectItem(item)
|
||||||
|
}
|
||||||
|
}
|
||||||
req(reqList, reqInfo)
|
req(reqList, reqInfo)
|
||||||
}
|
}
|
||||||
case actToggle:
|
case actToggle:
|
||||||
|
@ -865,16 +865,22 @@ class TestGoFZF < TestBase
|
|||||||
tmux.until { |lines| lines[-2].include? '(100)' }
|
tmux.until { |lines| lines[-2].include? '(100)' }
|
||||||
tmux.send_keys :Tab, :Tab
|
tmux.send_keys :Tab, :Tab
|
||||||
tmux.until { |lines| lines[-2].include? '(98)' }
|
tmux.until { |lines| lines[-2].include? '(98)' }
|
||||||
|
tmux.send_keys '100'
|
||||||
|
tmux.until { |lines| lines.match_count == 1 }
|
||||||
|
tmux.send_keys 'C-d'
|
||||||
|
tmux.until { |lines| lines[-2].include? '(97)' }
|
||||||
|
tmux.send_keys 'C-u'
|
||||||
|
tmux.until { |lines| lines.match_count == 100 }
|
||||||
tmux.send_keys 'C-d'
|
tmux.send_keys 'C-d'
|
||||||
tmux.until { |lines| !lines[-2].include? '(' }
|
tmux.until { |lines| !lines[-2].include? '(' }
|
||||||
tmux.send_keys :Tab, :Tab
|
tmux.send_keys :BTab, :BTab
|
||||||
tmux.until { |lines| lines[-2].include? '(2)' }
|
tmux.until { |lines| lines[-2].include? '(2)' }
|
||||||
tmux.send_keys 0
|
tmux.send_keys 0
|
||||||
tmux.until { |lines| lines[-2].include? '10/100' }
|
tmux.until { |lines| lines[-2].include? '10/100' }
|
||||||
tmux.send_keys 'C-a'
|
tmux.send_keys 'C-a'
|
||||||
tmux.until { |lines| lines[-2].include? '(12)' }
|
tmux.until { |lines| lines[-2].include? '(12)' }
|
||||||
tmux.send_keys :Enter
|
tmux.send_keys :Enter
|
||||||
assert_equal %w[2 1 10 20 30 40 50 60 70 80 90 100],
|
assert_equal %w[1 2 10 20 30 40 50 60 70 80 90 100],
|
||||||
readonce.split($INPUT_RECORD_SEPARATOR)
|
readonce.split($INPUT_RECORD_SEPARATOR)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user