mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-17 18:45:10 +00:00
Remove immediate flickering on reload action
This commit is contained in:
parent
ef80bd401f
commit
394d8cfd18
@ -3,6 +3,10 @@ CHANGELOG
|
|||||||
|
|
||||||
0.19.1 (WIP)
|
0.19.1 (WIP)
|
||||||
------
|
------
|
||||||
|
- Removed the immediate flicking of the screen on `reload` action.
|
||||||
|
```sh
|
||||||
|
: | fzf --bind 'change:reload:seq {q}' --phony
|
||||||
|
```
|
||||||
- It is now possible to split a composite bind action over multiple `--bind`
|
- It is now possible to split a composite bind action over multiple `--bind`
|
||||||
expressions by prefixing the later ones with `+`.
|
expressions by prefixing the later ones with `+`.
|
||||||
```sh
|
```sh
|
||||||
|
10
src/core.go
10
src/core.go
@ -224,10 +224,12 @@ func Run(opts *Options, revision string) {
|
|||||||
|
|
||||||
// Event coordination
|
// Event coordination
|
||||||
reading := true
|
reading := true
|
||||||
|
clearCache := false
|
||||||
ticks := 0
|
ticks := 0
|
||||||
var nextCommand *string
|
var nextCommand *string
|
||||||
restart := func(command string) {
|
restart := func(command string) {
|
||||||
reading = true
|
reading = true
|
||||||
|
clearCache = true
|
||||||
chunkList.Clear()
|
chunkList.Clear()
|
||||||
header = make([]string, 0, opts.HeaderLines)
|
header = make([]string, 0, opts.HeaderLines)
|
||||||
go reader.restart(command)
|
go reader.restart(command)
|
||||||
@ -250,11 +252,10 @@ func Run(opts *Options, revision string) {
|
|||||||
switch evt {
|
switch evt {
|
||||||
|
|
||||||
case EvtReadNew, EvtReadFin:
|
case EvtReadNew, EvtReadFin:
|
||||||
clearCache := false
|
|
||||||
if evt == EvtReadFin && nextCommand != nil {
|
if evt == EvtReadFin && nextCommand != nil {
|
||||||
clearCache = true
|
|
||||||
restart(*nextCommand)
|
restart(*nextCommand)
|
||||||
nextCommand = nil
|
nextCommand = nil
|
||||||
|
break
|
||||||
} else {
|
} else {
|
||||||
reading = reading && evt == EvtReadNew
|
reading = reading && evt == EvtReadNew
|
||||||
}
|
}
|
||||||
@ -264,6 +265,7 @@ func Run(opts *Options, revision string) {
|
|||||||
terminal.UpdateList(PassMerger(&snapshot, opts.Tac))
|
terminal.UpdateList(PassMerger(&snapshot, opts.Tac))
|
||||||
}
|
}
|
||||||
matcher.Reset(snapshot, input(), false, !reading, sort, clearCache)
|
matcher.Reset(snapshot, input(), false, !reading, sort, clearCache)
|
||||||
|
clearCache = false
|
||||||
|
|
||||||
case EvtSearchNew:
|
case EvtSearchNew:
|
||||||
var command *string
|
var command *string
|
||||||
@ -279,9 +281,11 @@ func Run(opts *Options, revision string) {
|
|||||||
} else {
|
} else {
|
||||||
restart(*command)
|
restart(*command)
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
snapshot, _ := chunkList.Snapshot()
|
snapshot, _ := chunkList.Snapshot()
|
||||||
matcher.Reset(snapshot, input(), true, !reading, sort, command != nil)
|
matcher.Reset(snapshot, input(), true, !reading, sort, clearCache)
|
||||||
|
clearCache = false
|
||||||
delay = false
|
delay = false
|
||||||
|
|
||||||
case EvtSearchProgress:
|
case EvtSearchProgress:
|
||||||
|
Loading…
Reference in New Issue
Block a user