[PR #677] [CLOSED] Added new finder primitive #1013

Closed
opened 2026-03-04 01:09:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rivo/tview/pull/677
Author: @lemoony
Created: 12/8/2021
Status: Closed

Base: masterHead: feature/finder


📝 Commits (10+)

  • 40a1fa9 Customize Colors of Autocomplete List
  • 343e76b Implemented finder primitive
  • 09ba6f4 Support custom matcher function + sort by score
  • e0ecf7d Fix finder wrapAround bug when scrolling above last item: reset item offset to zero
  • f330a4f Fix selection change doesn't get detected bug when filtering
  • 89f0d77 Add more styling options to finder primitive (#1)
  • ccdebce Merge pull request #2 from aditya-K2/autocompleteColors
  • 0ac570b Add SetHighlightMatchMaintainBackgroundColor styling option; adjust finder offset when currently matched items are out of view
  • c4e7978 Merge branch 'rivo:master' into feature/finder
  • 709500d Merge branch 'rivo:master' into snipkit

📊 Changes

7 files changed (+1038 additions, -8 deletions)

View changed files

demos/finder/README.md (+9 -0)
demos/finder/customatcher/main.go (+55 -0)
demos/finder/main.go (+64 -0)
demos/finder/screenshot.png (+0 -0)
finder.go (+855 -0)
📝 inputfield.go (+48 -8)
📝 util.go (+7 -0)

📄 Description

This change adds a new primitive called finder to tview:

grafik

It is inspired by go-fuzzfinder and fzf but more flexible in terms of appearance.

It allows to search within a list of items by typing. The primitive will filter the list accordingly and highlight all matches.

The finder primivite is a way to implement https://github.com/ktr0731/go-fuzzyfinder/issues/29. Since the primitive does allow to provide a custom matcher function, tview + go-fuzzfinder can be combined to allow fuzzy searching with the improved appearance configurations provided by tview.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/rivo/tview/pull/677 **Author:** [@lemoony](https://github.com/lemoony) **Created:** 12/8/2021 **Status:** ❌ Closed **Base:** `master` ← **Head:** `feature/finder` --- ### 📝 Commits (10+) - [`40a1fa9`](https://github.com/rivo/tview/commit/40a1fa9abf8e7ef0605af794b1f741594dff9848) Customize Colors of Autocomplete List - [`343e76b`](https://github.com/rivo/tview/commit/343e76b05281f09c97f3ed2dbca7cdcf6fae0df3) Implemented finder primitive - [`09ba6f4`](https://github.com/rivo/tview/commit/09ba6f481513c3ee36d1166a99fd659b73e32ffd) Support custom matcher function + sort by score - [`e0ecf7d`](https://github.com/rivo/tview/commit/e0ecf7d35e8427d23f95a0cf26f111ed97ad9298) Fix finder wrapAround bug when scrolling above last item: reset item offset to zero - [`f330a4f`](https://github.com/rivo/tview/commit/f330a4f4de783935fac28fce46b9fbd50870f06e) Fix selection change doesn't get detected bug when filtering - [`89f0d77`](https://github.com/rivo/tview/commit/89f0d77016e8692f4d049ea49cbb1549884ff530) Add more styling options to finder primitive (#1) - [`ccdebce`](https://github.com/rivo/tview/commit/ccdebce8015d3b708464c3a13fb819b01e93283c) Merge pull request #2 from aditya-K2/autocompleteColors - [`0ac570b`](https://github.com/rivo/tview/commit/0ac570b03bb668b11613cd60d0355890af0b9d9d) Add SetHighlightMatchMaintainBackgroundColor styling option; adjust finder offset when currently matched items are out of view - [`c4e7978`](https://github.com/rivo/tview/commit/c4e7978bc886ea074af53eabe2ed507391af298e) Merge branch 'rivo:master' into feature/finder - [`709500d`](https://github.com/rivo/tview/commit/709500d65dbfd9ceddbd3487cd5541ab9851d8a7) Merge branch 'rivo:master' into snipkit ### 📊 Changes **7 files changed** (+1038 additions, -8 deletions) <details> <summary>View changed files</summary> ➕ `demos/finder/README.md` (+9 -0) ➕ `demos/finder/customatcher/main.go` (+55 -0) ➕ `demos/finder/main.go` (+64 -0) ➕ `demos/finder/screenshot.png` (+0 -0) ➕ `finder.go` (+855 -0) 📝 `inputfield.go` (+48 -8) 📝 `util.go` (+7 -0) </details> ### 📄 Description This change adds a new primitive called `finder` to tview: <img width="349" alt="grafik" src="https://user-images.githubusercontent.com/2072743/147685054-566ba5ab-916d-4cdb-8963-dbe2f342390f.png"> It is inspired by [go-fuzzfinder](https://github.com/ktr0731/go-fuzzyfinder) and [fzf](https://github.com/junegunn/fzf) but more flexible in terms of appearance. It allows to search within a list of items by typing. The primitive will filter the list accordingly and highlight all matches. The finder primivite is a way to implement https://github.com/ktr0731/go-fuzzyfinder/issues/29. Since the primitive does allow to provide a custom matcher function, tview + go-fuzzfinder can be combined to allow fuzzy searching with the improved appearance configurations provided by tview. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:09:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#1013
No description provided.