summaryrefslogtreecommitdiffstats
path: root/src/constants.go
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2020-10-18 17:03:33 +0900
committerGitHub <noreply@github.com>2020-10-18 17:03:33 +0900
commitfaf68dbc5cc52201d0962f73baa5a049528b913c (patch)
tree12aaf9aa85163a8f140345d178b836d40e09342b /src/constants.go
parent305896fcb3b76c5ea94401f6cce74f0f287e8f21 (diff)
Implement streaming preview window (#2215)
Fix #2212 # Will start rendering after 200ms, update every 100ms fzf --preview 'for i in $(seq 100); do echo $i; sleep 0.01; done' # Should print "Loading .." message after 500ms fzf --preview 'sleep 1; for i in $(seq 100); do echo $i; sleep 0.01; done' # The first line should appear after 200ms fzf --preview 'date; sleep 2; date' # Should not render before enough lines for the scroll offset are ready rg --line-number --no-heading --color=always ^ | fzf --delimiter : --ansi --preview-window '+{2}-/2' \ --preview 'sleep 1; bat --style=numbers --color=always --pager=never --highlight-line={2} {1}'
Diffstat (limited to 'src/constants.go')
-rw-r--r--src/constants.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/constants.go b/src/constants.go
index b7315024..9a5b8fa3 100644
--- a/src/constants.go
+++ b/src/constants.go
@@ -27,6 +27,8 @@ const (
initialDelayTac = 100 * time.Millisecond
spinnerDuration = 100 * time.Millisecond
previewCancelWait = 500 * time.Millisecond
+ previewChunkDelay = 100 * time.Millisecond
+ previewDelayed = 500 * time.Millisecond
maxPatternLength = 300
maxMulti = math.MaxInt32