mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-21 23:43:50 -07:00
Compare commits
6 Commits
0.24.0-rc1
...
0.24.0
Author | SHA1 | Date | |
---|---|---|---|
|
0d5f862daf | ||
|
51dfacd542 | ||
|
c691d52fa7 | ||
|
de3d09fe79 | ||
|
eaa413c566 | ||
|
407205e52b |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -29,6 +29,24 @@ CHANGELOG
|
|||||||
```
|
```
|
||||||
- More `--border` options
|
- More `--border` options
|
||||||
- `vertical`, `top`, `bottom`, `left`, `right`
|
- `vertical`, `top`, `bottom`, `left`, `right`
|
||||||
|
- Updated Vim plugin to use these new `--border` options
|
||||||
|
```vim
|
||||||
|
" Floating popup window in the center of the screen
|
||||||
|
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.6 } }
|
||||||
|
|
||||||
|
" Popup with 100% width
|
||||||
|
let g:fzf_layout = { 'window': { 'width': 1.0, 'height': 0.5, 'border': 'horizontal' } }
|
||||||
|
|
||||||
|
" Popup with 100% height
|
||||||
|
let g:fzf_layout = { 'window': { 'width': 0.5, 'height': 1.0, 'border': 'vertical' } }
|
||||||
|
|
||||||
|
" Similar to 'down' layout, but it uses a popup window and doesn't affect the window layout
|
||||||
|
let g:fzf_layout = { 'window': { 'width': 1.0, 'height': 0.5, 'yoffset': 1.0, 'border': 'top' } }
|
||||||
|
|
||||||
|
" Opens on the right;
|
||||||
|
" 'highlight' option is still supported but it will only take the foreground color of the group
|
||||||
|
let g:fzf_layout = { 'window': { 'width': 0.5, 'height': 1.0, 'xoffset': 1.0, 'border': 'left', 'highlight': 'Comment' } }
|
||||||
|
```
|
||||||
- To indicate if `--multi` mode is enabled, fzf will print the number of
|
- To indicate if `--multi` mode is enabled, fzf will print the number of
|
||||||
selected items even when no item is selected
|
selected items even when no item is selected
|
||||||
```sh
|
```sh
|
||||||
@@ -39,6 +57,7 @@ CHANGELOG
|
|||||||
seq 100 | fzf --multi 5
|
seq 100 | fzf --multi 5
|
||||||
# 100/100 (0/5)
|
# 100/100 (0/5)
|
||||||
```
|
```
|
||||||
|
- Since 0.24.0, release binaries will be uploaded to https://github.com/junegunn/fzf/releases
|
||||||
|
|
||||||
0.23.1
|
0.23.1
|
||||||
------
|
------
|
||||||
|
44
Makefile
44
Makefile
@@ -6,6 +6,8 @@ ROOT_DIR := $(shell dirname $(MAKEFILE))
|
|||||||
SOURCES := $(wildcard *.go src/*.go src/*/*.go) $(MAKEFILE)
|
SOURCES := $(wildcard *.go src/*.go src/*/*.go) $(MAKEFILE)
|
||||||
|
|
||||||
VERSION := $(shell git describe --abbrev=0)
|
VERSION := $(shell git describe --abbrev=0)
|
||||||
|
VERSION_TRIM := $(shell sed "s/-.*//" <<< $(VERSION))
|
||||||
|
VERSION_REGEX := $(subst .,\.,$(VERSION_TRIM))
|
||||||
REVISION := $(shell git log -n 1 --pretty=format:%h -- $(SOURCES))
|
REVISION := $(shell git log -n 1 --pretty=format:%h -- $(SOURCES))
|
||||||
BUILD_FLAGS := -a -ldflags "-X main.version=$(VERSION) -X main.revision=$(REVISION) -w '-extldflags=$(LDFLAGS)'" -tags "$(TAGS)"
|
BUILD_FLAGS := -a -ldflags "-X main.version=$(VERSION) -X main.revision=$(REVISION) -w '-extldflags=$(LDFLAGS)'" -tags "$(TAGS)"
|
||||||
|
|
||||||
@@ -15,7 +17,6 @@ BINARYARM6 := fzf-$(GOOS)_arm6
|
|||||||
BINARYARM7 := fzf-$(GOOS)_arm7
|
BINARYARM7 := fzf-$(GOOS)_arm7
|
||||||
BINARYARM8 := fzf-$(GOOS)_arm8
|
BINARYARM8 := fzf-$(GOOS)_arm8
|
||||||
BINARYPPC64LE := fzf-$(GOOS)_ppc64le
|
BINARYPPC64LE := fzf-$(GOOS)_ppc64le
|
||||||
VERSION := $(shell awk -F= '/version =/ {print $$2}' src/constants.go | tr -d "\" ")
|
|
||||||
|
|
||||||
# https://en.wikipedia.org/wiki/Uname
|
# https://en.wikipedia.org/wiki/Uname
|
||||||
UNAME_M := $(shell uname -m)
|
UNAME_M := $(shell uname -m)
|
||||||
@@ -36,7 +37,7 @@ else ifeq ($(UNAME_M),aarch64)
|
|||||||
else ifeq ($(UNAME_M),ppc64le)
|
else ifeq ($(UNAME_M),ppc64le)
|
||||||
BINARY := $(BINARYPPC64LE)
|
BINARY := $(BINARYPPC64LE)
|
||||||
else
|
else
|
||||||
$(error "Build on $(UNAME_M) is not supported, yet.")
|
$(error Build on $(UNAME_M) is not supported, yet.)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
all: target/$(BINARY)
|
all: target/$(BINARY)
|
||||||
@@ -50,9 +51,44 @@ test: $(SOURCES)
|
|||||||
|
|
||||||
install: bin/fzf
|
install: bin/fzf
|
||||||
|
|
||||||
release:
|
build:
|
||||||
goreleaser --rm-dist --snapshot
|
goreleaser --rm-dist --snapshot
|
||||||
|
|
||||||
|
release:
|
||||||
|
ifndef GITHUB_TOKEN
|
||||||
|
$(error GITHUB_TOKEN is not defined)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Check if we are on master branch
|
||||||
|
ifneq ($(shell git symbolic-ref --short HEAD),master)
|
||||||
|
$(error Not on master branch)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Check if version numbers are properly updated
|
||||||
|
grep -q ^$(VERSION_REGEX)$$ CHANGELOG.md
|
||||||
|
grep -qF '"fzf $(VERSION_TRIM)"' man/man1/fzf.1
|
||||||
|
grep -qF '"fzf $(VERSION_TRIM)"' man/man1/fzf-tmux.1
|
||||||
|
grep -qF $(VERSION) install
|
||||||
|
grep -qF $(VERSION) install.ps1
|
||||||
|
|
||||||
|
# Make release note out of CHANGELOG.md
|
||||||
|
sed -n '/^$(VERSION_REGEX)$$/,/^[0-9]/p' CHANGELOG.md | tail -r | \
|
||||||
|
sed '1,/^ *$$/d' | tail -r | sed 1,2d | tee tmp/release-note
|
||||||
|
|
||||||
|
# Push to temp branch first so that install scripts always works on master branch
|
||||||
|
git checkout -B temp master
|
||||||
|
git push origin temp --follow-tags --force
|
||||||
|
|
||||||
|
# Make a GitHub release
|
||||||
|
goreleaser --rm-dist --release-notes tmp/release-note
|
||||||
|
|
||||||
|
# Push to master
|
||||||
|
git checkout master
|
||||||
|
git push origin master
|
||||||
|
|
||||||
|
# Delete temp branch
|
||||||
|
git push origin --delete temp
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(RM) -r dist target
|
$(RM) -r dist target
|
||||||
|
|
||||||
@@ -90,4 +126,4 @@ update:
|
|||||||
$(GO) get -u
|
$(GO) get -u
|
||||||
$(GO) mod tidy
|
$(GO) mod tidy
|
||||||
|
|
||||||
.PHONY: all release test install clean docker docker-test update
|
.PHONY: all build release test install clean docker docker-test update
|
||||||
|
@@ -298,7 +298,6 @@ following options are allowed:
|
|||||||
- Optional:
|
- Optional:
|
||||||
- `yoffset` [float default 0.5 range [0 ~ 1]]
|
- `yoffset` [float default 0.5 range [0 ~ 1]]
|
||||||
- `xoffset` [float default 0.5 range [0 ~ 1]]
|
- `xoffset` [float default 0.5 range [0 ~ 1]]
|
||||||
- `highlight` [string default `'Comment'`]: Highlight group for border
|
|
||||||
- `border` [string default `rounded`]: Border style
|
- `border` [string default `rounded`]: Border style
|
||||||
- `rounded` / `sharp` / `horizontal` / `vertical` / `top` / `bottom` / `left` / `right` / `none`
|
- `rounded` / `sharp` / `horizontal` / `vertical` / `top` / `bottom` / `left` / `right` / `none`
|
||||||
|
|
||||||
|
2
install
2
install
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
version=0.24.0-rc1
|
version=0.24.0
|
||||||
auto_completion=
|
auto_completion=
|
||||||
key_bindings=
|
key_bindings=
|
||||||
update_config=2
|
update_config=2
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
$version="0.24.0-rc1"
|
$version="0.24.0"
|
||||||
|
|
||||||
$fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition
|
$fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition
|
||||||
|
|
||||||
|
@@ -128,7 +128,7 @@ endfunction
|
|||||||
|
|
||||||
function! s:default_layout()
|
function! s:default_layout()
|
||||||
return s:popup_support()
|
return s:popup_support()
|
||||||
\ ? { 'window' : { 'width': 0.9, 'height': 0.6, 'highlight': 'Normal' } }
|
\ ? { 'window' : { 'width': 0.9, 'height': 0.6 } }
|
||||||
\ : { 'down': '~40%' }
|
\ : { 'down': '~40%' }
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -437,7 +437,7 @@ try
|
|||||||
let prefix = '( '.source.' )|'
|
let prefix = '( '.source.' )|'
|
||||||
elseif type == 3
|
elseif type == 3
|
||||||
let temps.input = s:fzf_tempname()
|
let temps.input = s:fzf_tempname()
|
||||||
call writefile(map(source, '<SID>enc_to_cp(v:val)'), temps.input)
|
call writefile(source, temps.input)
|
||||||
let prefix = (s:is_win ? 'type ' : 'cat ').fzf#shellescape(temps.input).'|'
|
let prefix = (s:is_win ? 'type ' : 'cat ').fzf#shellescape(temps.input).'|'
|
||||||
else
|
else
|
||||||
throw 'Invalid source type'
|
throw 'Invalid source type'
|
||||||
|
@@ -1855,13 +1855,9 @@ func (t *Terminal) Loop() {
|
|||||||
reader := bufio.NewReader(out)
|
reader := bufio.NewReader(out)
|
||||||
eofChan := make(chan bool)
|
eofChan := make(chan bool)
|
||||||
finishChan := make(chan bool, 1)
|
finishChan := make(chan bool, 1)
|
||||||
reapChan := make(chan bool)
|
|
||||||
err := cmd.Start()
|
err := cmd.Start()
|
||||||
reaps := 0
|
if err == nil {
|
||||||
if err != nil {
|
reapChan := make(chan bool)
|
||||||
t.reqBox.Set(reqPreviewDisplay, previewResult{version, []string{err.Error()}, 0, ""})
|
|
||||||
} else {
|
|
||||||
reaps = 2
|
|
||||||
lineChan := make(chan eachLine)
|
lineChan := make(chan eachLine)
|
||||||
// Goroutine 1 reads process output
|
// Goroutine 1 reads process output
|
||||||
go func() {
|
go func() {
|
||||||
@@ -1874,6 +1870,7 @@ func (t *Terminal) Loop() {
|
|||||||
}
|
}
|
||||||
eofChan <- true
|
eofChan <- true
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// Goroutine 2 periodically requests rendering
|
// Goroutine 2 periodically requests rendering
|
||||||
go func(version int64) {
|
go func(version int64) {
|
||||||
lines := []string{}
|
lines := []string{}
|
||||||
@@ -1915,42 +1912,47 @@ func (t *Terminal) Loop() {
|
|||||||
ticker.Stop()
|
ticker.Stop()
|
||||||
reapChan <- true
|
reapChan <- true
|
||||||
}(version)
|
}(version)
|
||||||
}
|
|
||||||
// Goroutine 3 is responsible for cancelling running preview command
|
// Goroutine 3 is responsible for cancelling running preview command
|
||||||
go func(version int64) {
|
go func(version int64) {
|
||||||
timer := time.NewTimer(previewDelayed)
|
timer := time.NewTimer(previewDelayed)
|
||||||
Loop:
|
Loop:
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-timer.C:
|
case <-timer.C:
|
||||||
t.reqBox.Set(reqPreviewDelayed, version)
|
t.reqBox.Set(reqPreviewDelayed, version)
|
||||||
case code := <-t.killChan:
|
case code := <-t.killChan:
|
||||||
if code != exitCancel {
|
if code != exitCancel {
|
||||||
util.KillCommand(cmd)
|
|
||||||
os.Exit(code)
|
|
||||||
} else {
|
|
||||||
timer := time.NewTimer(previewCancelWait)
|
|
||||||
select {
|
|
||||||
case <-timer.C:
|
|
||||||
util.KillCommand(cmd)
|
util.KillCommand(cmd)
|
||||||
case <-finishChan:
|
os.Exit(code)
|
||||||
|
} else {
|
||||||
|
timer := time.NewTimer(previewCancelWait)
|
||||||
|
select {
|
||||||
|
case <-timer.C:
|
||||||
|
util.KillCommand(cmd)
|
||||||
|
case <-finishChan:
|
||||||
|
}
|
||||||
|
timer.Stop()
|
||||||
}
|
}
|
||||||
timer.Stop()
|
break Loop
|
||||||
|
case <-finishChan:
|
||||||
|
break Loop
|
||||||
}
|
}
|
||||||
break Loop
|
|
||||||
case <-finishChan:
|
|
||||||
break Loop
|
|
||||||
}
|
}
|
||||||
}
|
timer.Stop()
|
||||||
timer.Stop()
|
reapChan <- true
|
||||||
reapChan <- true
|
}(version)
|
||||||
}(version)
|
|
||||||
<-eofChan
|
<-eofChan // Goroutine 1 finished
|
||||||
cmd.Wait() // NOTE: We should not call Wait before EOF
|
cmd.Wait() // NOTE: We should not call Wait before EOF
|
||||||
finishChan <- true
|
finishChan <- true // Tell Goroutine 3 to stop
|
||||||
for i := 0; i < reaps; i++ {
|
<-reapChan // Goroutine 2 and 3 finished
|
||||||
<-reapChan
|
<-reapChan
|
||||||
|
} else {
|
||||||
|
// Failed to start the command. Report the error immediately.
|
||||||
|
t.reqBox.Set(reqPreviewDisplay, previewResult{version, []string{err.Error()}, 0, ""})
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanTemporaryFiles()
|
cleanTemporaryFiles()
|
||||||
} else {
|
} else {
|
||||||
t.reqBox.Set(reqPreviewDisplay, previewResult{version, nil, 0, ""})
|
t.reqBox.Set(reqPreviewDisplay, previewResult{version, nil, 0, ""})
|
||||||
|
Reference in New Issue
Block a user