Compare commits

..

6 Commits

Author SHA1 Message Date
Daniel Levin
06e70570e2 Update Makefile to support builds on Illumos
Some checks are pending
CodeQL / Analyze (go) (push) Waiting to run
build / build (push) Waiting to run
Test fzf on macOS / build (push) Waiting to run
Close #4772
2026-04-13 20:07:55 +09:00
Junegunn Choi
bd4a18d0a9 Replace sort.Sort(ByOrder(...)) with slices.SortFunc
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2026-04-12 10:43:47 +09:00
Junegunn Choi
1b0d448c6e Update README: --tmux -> --popup 2026-04-12 09:57:26 +09:00
Junegunn Choi
f584cf38f7 [bash] Persist history deletion when histappend is on
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
Fix #4764

Patch suggested by @bitraid.
2026-04-11 17:03:25 +09:00
Junegunn Choi
0eb2ae9f8b Fix gutter display in --style=minimal
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
2026-04-08 23:28:10 +09:00
Junegunn Choi
1831500018 Update README
Some checks failed
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled
I was unable to make the sponsors action to work with the new branch
protection rule. So I'm removing the sponsors section for now until
I can properly set it up again.
2026-04-05 22:20:25 +09:00
8 changed files with 47 additions and 62 deletions

View File

@@ -1,24 +0,0 @@
---
name: Generate Sponsors README
on:
workflow_dispatch:
schedule:
- cron: 0 15 * * 6
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v5
- name: Generate Sponsors 💖
uses: JamesIves/github-sponsors-readme-action@2fd9142e765f755780202122261dc85e78459405 # v1
with:
token: ${{ secrets.SPONSORS_TOKEN }}
file: 'README.md'
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4
with:
branch: master
folder: '.'

View File

@@ -53,6 +53,8 @@ ifeq ($(UNAME_M),x86_64)
BINARY := $(BINARY64) BINARY := $(BINARY64)
else ifeq ($(UNAME_M),amd64) else ifeq ($(UNAME_M),amd64)
BINARY := $(BINARY64) BINARY := $(BINARY64)
else ifeq ($(UNAME_M),i86pc)
BINARY := $(BINARY64)
else ifeq ($(UNAME_M),s390x) else ifeq ($(UNAME_M),s390x)
BINARY := $(BINARYS390) BINARY := $(BINARYS390)
else ifeq ($(UNAME_M),i686) else ifeq ($(UNAME_M),i686)

File diff suppressed because one or more lines are too long

View File

@@ -84,6 +84,10 @@ __fzf_history_delete() {
for offset in "${offsets[@]}"; do for offset in "${offsets[@]}"; do
builtin history -d "$offset" builtin history -d "$offset"
done done
if [[ ${#offsets[@]} -gt 0 ]] && shopt -q histappend; then
builtin history -w
fi
} }
if command -v perl > /dev/null; then if command -v perl > /dev/null; then

View File

@@ -3516,7 +3516,9 @@ func applyPreset(opts *Options, preset string) error {
opts.Preview.border = tui.BorderLine opts.Preview.border = tui.BorderLine
opts.Preview.info = false opts.Preview.info = false
opts.InfoStyle = infoDefault opts.InfoStyle = infoDefault
opts.Theme.Gutter = tui.ColorAttr{Color: -1, Attr: 0} opts.Theme.Gutter = tui.NewColorAttr()
space := " "
opts.Gutter = &space
empty := "" empty := ""
opts.Separator = &empty opts.Separator = &empty
opts.Scrollbar = &empty opts.Scrollbar = &empty

View File

@@ -2,6 +2,7 @@ package fzf
import ( import (
"math" "math"
"slices"
"sort" "sort"
"unicode" "unicode"
@@ -30,7 +31,7 @@ type Result struct {
func buildResult(item *Item, offsets []Offset, score int) Result { func buildResult(item *Item, offsets []Offset, score int) Result {
if len(offsets) > 1 { if len(offsets) > 1 {
sort.Sort(ByOrder(offsets)) slices.SortFunc(offsets, compareOffsets)
} }
minBegin := math.MaxUint16 minBegin := math.MaxUint16
@@ -187,7 +188,7 @@ func (result *Result) colorOffsets(matchOffsets []Offset, nthOffsets []Offset, t
} }
} }
// sort.Sort(ByOrder(offsets)) // slices.SortFunc(offsets, compareOffsets)
// Merge offsets // Merge offsets
// ------------ ---- -- ---- // ------------ ---- -- ----
@@ -297,21 +298,20 @@ func (result *Result) colorOffsets(matchOffsets []Offset, nthOffsets []Offset, t
return colors return colors
} }
// ByOrder is for sorting substring offsets func compareOffsets(a, b Offset) int {
type ByOrder []Offset if a[0] < b[0] {
return -1
func (a ByOrder) Len() int {
return len(a)
} }
if a[0] > b[0] {
func (a ByOrder) Swap(i, j int) { return 1
a[i], a[j] = a[j], a[i]
} }
if a[1] < b[1] {
func (a ByOrder) Less(i, j int) bool { return -1
ioff := a[i] }
joff := a[j] if a[1] > b[1] {
return (ioff[0] < joff[0]) || (ioff[0] == joff[0]) && (ioff[1] <= joff[1]) return 1
}
return 0
} }
// ByRelevance is for sorting Items // ByRelevance is for sorting Items

View File

@@ -3,6 +3,7 @@ package fzf
import ( import (
"math" "math"
"math/rand" "math/rand"
"slices"
"sort" "sort"
"testing" "testing"
@@ -19,7 +20,7 @@ func TestOffsetSort(t *testing.T) {
offsets := []Offset{ offsets := []Offset{
{3, 5}, {2, 7}, {3, 5}, {2, 7},
{1, 3}, {2, 9}} {1, 3}, {2, 9}}
sort.Sort(ByOrder(offsets)) slices.SortFunc(offsets, compareOffsets)
if offsets[0][0] != 1 || offsets[0][1] != 3 || if offsets[0][0] != 1 || offsets[0][1] != 3 ||
offsets[1][0] != 2 || offsets[1][1] != 7 || offsets[1][0] != 2 || offsets[1][1] != 7 ||

View File

@@ -13,6 +13,7 @@ import (
"os/exec" "os/exec"
"os/signal" "os/signal"
"regexp" "regexp"
"slices"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
@@ -3751,7 +3752,7 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
offset := Offset{int32(p), int32(p + w)} offset := Offset{int32(p), int32(p + w)}
charOffsets[idx] = offset charOffsets[idx] = offset
} }
sort.Sort(ByOrder(charOffsets)) slices.SortFunc(charOffsets, compareOffsets)
} }
// When postTask is nil, we're printing header lines. No need to care about nth. // When postTask is nil, we're printing header lines. No need to care about nth.
@@ -3788,7 +3789,7 @@ func (t *Terminal) printHighlighted(result Result, colBase tui.ColorPair, colMat
end := start + int32(length) end := start + int32(length)
nthOffsets[i] = Offset{int32(start), int32(end)} nthOffsets[i] = Offset{int32(start), int32(end)}
} }
sort.Sort(ByOrder(nthOffsets)) slices.SortFunc(nthOffsets, compareOffsets)
} }
} }
allOffsets := result.colorOffsets(charOffsets, nthOffsets, t.theme, colBase, colMatch, t.nthAttr, nthOverlay, hidden) allOffsets := result.colorOffsets(charOffsets, nthOffsets, t.theme, colBase, colMatch, t.nthAttr, nthOverlay, hidden)