Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ecd3b6
commit 4ba1017
Showing
9 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
![](./demo.gif) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
|
||
"github.com/koki-develop/go-fzf" | ||
) | ||
|
||
func main() { | ||
items := []string{"hello", "world", "foo", "bar"} | ||
|
||
f, err := fzf.New( | ||
fzf.WithInputPosition(fzf.InputPositionBottom), | ||
) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
idxs, err := f.Find(items, func(i int) string { return items[i] }) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
|
||
for _, i := range idxs { | ||
fmt.Println(items[i]) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# configuration | ||
Output ./examples/input-position/demo.gif | ||
Set Shell "bash" | ||
Set FontSize 32 | ||
Set Width 1200 | ||
Set Height 600 | ||
|
||
# setup | ||
Hide | ||
Type "mkdir ./tmp" Enter | ||
Type "cp ./examples/input-position/main.go ./tmp/main.go" Enter | ||
Type "cd ./tmp" Enter | ||
Ctrl+l | ||
Show | ||
|
||
# --- | ||
|
||
Type "go run ./main.go" Sleep 750ms Enter | ||
Sleep 2s | ||
|
||
Up 2 | ||
Sleep 1s | ||
|
||
Down 2 | ||
Sleep 1s | ||
|
||
Type "world" | ||
Sleep 750ms | ||
|
||
Enter | ||
|
||
Sleep 3s | ||
|
||
# --- | ||
|
||
# cleanup | ||
Hide | ||
Type "cd ../" Enter | ||
Type "\rm -rf ./tmp" Enter |