From 0d5f862daf45336c12c2f540736b3d7ca396c78d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 27 Oct 2020 13:53:24 +0900 Subject: 0.24.0 --- CHANGELOG.md | 19 +++++++++++++++++++ Makefile | 44 ++++++++++++++++++++++++++++++++++++++++---- README-VIM.md | 1 - install | 2 +- install.ps1 | 2 +- plugin/fzf.vim | 2 +- 6 files changed, 62 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 626105cd..3c368652 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,24 @@ CHANGELOG ``` - More `--border` options - `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 selected items even when no item is selected ```sh @@ -39,6 +57,7 @@ CHANGELOG seq 100 | fzf --multi 5 # 100/100 (0/5) ``` +- Since 0.24.0, release binaries will be uploaded to https://github.com/junegunn/fzf/releases 0.23.1 ------ diff --git a/Makefile b/Makefile index 5b0a278e..4308d373 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,8 @@ ROOT_DIR := $(shell dirname $(MAKEFILE)) SOURCES := $(wildcard *.go src/*.go src/*/*.go) $(MAKEFILE) 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)) 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 BINARYARM8 := fzf-$(GOOS)_arm8 BINARYPPC64LE := fzf-$(GOOS)_ppc64le -VERSION := $(shell awk -F= '/version =/ {print $$2}' src/constants.go | tr -d "\" ") # https://en.wikipedia.org/wiki/Uname UNAME_M := $(shell uname -m) @@ -36,7 +37,7 @@ else ifeq ($(UNAME_M),aarch64) else ifeq ($(UNAME_M),ppc64le) BINARY := $(BINARYPPC64LE) else -$(error "Build on $(UNAME_M) is not supported, yet.") +$(error Build on $(UNAME_M) is not supported, yet.) endif all: target/$(BINARY) @@ -50,9 +51,44 @@ test: $(SOURCES) install: bin/fzf -release: +build: 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: $(RM) -r dist target @@ -90,4 +126,4 @@ update: $(GO) get -u $(GO) mod tidy -.PHONY: all release test install clean docker docker-test update +.PHONY: all build release test install clean docker docker-test update diff --git a/README-VIM.md b/README-VIM.md index e6325261..e6124d65 100644 --- a/README-VIM.md +++ b/README-VIM.md @@ -298,7 +298,6 @@ following options are allowed: - Optional: - `yoffset` [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 - `rounded` / `sharp` / `horizontal` / `vertical` / `top` / `bottom` / `left` / `right` / `none` diff --git a/install b/install index e7049093..e1efce6e 100755 --- a/install +++ b/install @@ -2,7 +2,7 @@ set -u -version=0.24.0-rc1 +version=0.24.0 auto_completion= key_bindings= update_config=2 diff --git a/install.ps1 b/install.ps1 index 855a6f34..8b705840 100644 --- a/install.ps1 +++ b/install.ps1 @@ -1,4 +1,4 @@ -$version="0.24.0-rc1" +$version="0.24.0" $fzf_base=Split-Path -Parent $MyInvocation.MyCommand.Definition diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 50fcbc02..9f280c00 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -128,7 +128,7 @@ endfunction function! s:default_layout() return s:popup_support() - \ ? { 'window' : { 'width': 0.9, 'height': 0.6, 'highlight': 'Normal' } } + \ ? { 'window' : { 'width': 0.9, 'height': 0.6 } } \ : { 'down': '~40%' } endfunction -- cgit v1.2.3