mirror of
https://github.com/junegunn/fzf.git
synced 2025-08-02 13:12:00 -07:00
[tests] Add testing of keyboard events in FullscreenRenderer.GetChar()
This contains one test case of each tcell.Key* event type that can be sent to and subsequently processed in fzf's GetChar(). The test cases describe status quo, and all of them PASS. Small function util.ToTty() was added. It is similar to util.IsTty(), but for stdout (hence the To preposition).
This commit is contained in:
committed by
Junegunn Choi
parent
4173e94c6f
commit
00fb486f6a
@@ -117,11 +117,16 @@ func DurWithin(
|
||||
return val
|
||||
}
|
||||
|
||||
// IsTty returns true is stdin is a terminal
|
||||
// IsTty returns true if stdin is a terminal
|
||||
func IsTty() bool {
|
||||
return isatty.IsTerminal(os.Stdin.Fd())
|
||||
}
|
||||
|
||||
// ToTty returns true if stdout is a terminal
|
||||
func ToTty() bool {
|
||||
return isatty.IsTerminal(os.Stdout.Fd())
|
||||
}
|
||||
|
||||
// Once returns a function that returns the specified boolean value only once
|
||||
func Once(nextResponse bool) func() bool {
|
||||
state := nextResponse
|
||||
|
Reference in New Issue
Block a user