mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 12:55:47 +02:00
start refactoring gui
This commit is contained in:
parent
fa8571e1f4
commit
a90b6efded
61 changed files with 1779 additions and 1522 deletions
27
pkg/utils/string_stack.go
Normal file
27
pkg/utils/string_stack.go
Normal file
|
@ -0,0 +1,27 @@
|
|||
package utils
|
||||
|
||||
type StringStack struct {
|
||||
stack []string
|
||||
}
|
||||
|
||||
func (self *StringStack) Push(s string) {
|
||||
self.stack = append(self.stack, s)
|
||||
}
|
||||
|
||||
func (self *StringStack) Pop() string {
|
||||
if len(self.stack) == 0 {
|
||||
return ""
|
||||
}
|
||||
n := len(self.stack) - 1
|
||||
last := self.stack[n]
|
||||
self.stack = self.stack[:n]
|
||||
return last
|
||||
}
|
||||
|
||||
func (self *StringStack) IsEmpty() bool {
|
||||
return len(self.stack) == 0
|
||||
}
|
||||
|
||||
func (self *StringStack) Clear() {
|
||||
self.stack = []string{}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue