mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
Switch to github.com/gookit/color for terminal colors
This commit is contained in:
parent
a3b820fb5f
commit
79848087bc
100 changed files with 12406 additions and 1704 deletions
48
vendor/github.com/xo/terminfo/stack.go
generated
vendored
Normal file
48
vendor/github.com/xo/terminfo/stack.go
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
package terminfo
|
||||
|
||||
type stack []interface{}
|
||||
|
||||
func (s *stack) push(v interface{}) {
|
||||
*s = append(*s, v)
|
||||
}
|
||||
|
||||
func (s *stack) pop() interface{} {
|
||||
if len(*s) == 0 {
|
||||
return nil
|
||||
}
|
||||
v := (*s)[len(*s)-1]
|
||||
*s = (*s)[:len(*s)-1]
|
||||
return v
|
||||
}
|
||||
|
||||
func (s *stack) popInt() int {
|
||||
if i, ok := s.pop().(int); ok {
|
||||
return i
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (s *stack) popBool() bool {
|
||||
if b, ok := s.pop().(bool); ok {
|
||||
return b
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *stack) popByte() byte {
|
||||
if b, ok := s.pop().(byte); ok {
|
||||
return b
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (s *stack) popString() string {
|
||||
if a, ok := s.pop().(string); ok {
|
||||
return a
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (s *stack) reset() {
|
||||
*s = (*s)[:0]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue