diff options
author | Junegunn Choi <junegunn.c@gmail.com> | 2019-11-10 11:36:22 +0900 |
---|---|---|
committer | Junegunn Choi <junegunn.c@gmail.com> | 2019-11-10 11:43:37 +0900 |
commit | 78da9287272a0bfa183498c5b2e9fde10a3663a0 (patch) | |
tree | 4318915c919024604777e16d49ae14a838564804 /src/chunklist.go | |
parent | 11962dabba69e706246bfcd54fa42b1e1c6bee8b (diff) |
Experimental implementation of "reload" action
# Reload input list with different sources
seq 10 | fzf --bind 'ctrl-a:reload(seq 100),ctrl-b:reload(seq 1000)'
# Reload as you type
seq 10 | fzf --bind 'change:reload:seq {q}' --phony
# Integration with ripgrep
RG_PREFIX="rg --column --line-number --no-heading --color=always --smart-case "
INITIAL_QUERY=""
FZF_DEFAULT_COMMAND="$RG_PREFIX '$INITIAL_QUERY'" \
fzf --bind "change:reload:$RG_PREFIX {q} || true" \
--ansi --phony --query "$INITIAL_QUERY"
Close #751
Close #965
Close #974
Close #1736
Related #1723
Diffstat (limited to 'src/chunklist.go')
-rw-r--r-- | src/chunklist.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/chunklist.go b/src/chunklist.go index 510cd734..cd635c25 100644 --- a/src/chunklist.go +++ b/src/chunklist.go @@ -64,6 +64,13 @@ func (cl *ChunkList) Push(data []byte) bool { return ret } +// Clear clears the data +func (cl *ChunkList) Clear() { + cl.mutex.Lock() + cl.chunks = nil + cl.mutex.Unlock() +} + // Snapshot returns immutable snapshot of the ChunkList func (cl *ChunkList) Snapshot() ([]*Chunk, int) { cl.mutex.Lock() |