mirror of
https://github.com/junegunn/fzf.git
synced 2026-03-05 14:44:31 +08:00
Fix track-current unset after a combined movement action
Fix #4649 Close #4663
This commit is contained in:
@@ -292,14 +292,32 @@ func defaultMargin() [4]sizeSpec {
|
||||
return [4]sizeSpec{}
|
||||
}
|
||||
|
||||
type trackOption int
|
||||
type trackOption struct {
|
||||
enabled bool
|
||||
index int32
|
||||
}
|
||||
|
||||
const (
|
||||
trackDisabled trackOption = iota
|
||||
trackEnabled
|
||||
trackCurrent
|
||||
var (
|
||||
trackDisabled = trackOption{false, minItem.Index()}
|
||||
trackEnabled = trackOption{true, minItem.Index()}
|
||||
)
|
||||
|
||||
func (t trackOption) Disabled() bool {
|
||||
return !t.enabled
|
||||
}
|
||||
|
||||
func (t trackOption) Global() bool {
|
||||
return t.enabled && t.index == minItem.Index()
|
||||
}
|
||||
|
||||
func (t trackOption) Current() bool {
|
||||
return t.enabled && t.index != minItem.Index()
|
||||
}
|
||||
|
||||
func trackCurrent(index int32) trackOption {
|
||||
return trackOption{true, index}
|
||||
}
|
||||
|
||||
type windowPosition int
|
||||
|
||||
const (
|
||||
|
||||
Reference in New Issue
Block a user