Skip to content

Commit

Permalink
Merge pull request #355 from peco/topic/issue-354
Browse files Browse the repository at this point in the history
Fix InvertSelection command
  • Loading branch information
lestrrat committed Oct 5, 2016
2 parents 93068da + 72746ab commit c29ba5a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions action.go
Expand Up @@ -370,13 +370,16 @@ func doInvertSelection(ctx context.Context, state *Peco, _ termbox.Event) {
}

selection := state.Selection()
selection.Reset()
b := state.CurrentLineBuffer()

for x := 0; x < b.Size(); x++ {
if l, err := b.LineAt(x); err == nil {
l.SetDirty(true)
selection.Add(l)
if selection.Has(l) {
selection.Remove(l)
} else {
selection.Add(l)
}
} else {
selection.Remove(l)
}
Expand Down

0 comments on commit c29ba5a

Please sign in to comment.