mirror of https://github.com/liamg/aminal.git
top working
This commit is contained in:
parent
73fd6ba00b
commit
43eaece5ca
|
@ -140,13 +140,14 @@ func (terminal *Terminal) hideCursor() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (terminal *Terminal) incrementPosition() {
|
func (terminal *Terminal) incrementPosition() {
|
||||||
position := terminal.getPosition()
|
terminal.SetPosition(terminal.position.Col+1, terminal.position.Line)
|
||||||
position.Col++
|
|
||||||
terminal.SetPosition(position)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (terminal *Terminal) SetPosition(position Position) {
|
func (terminal *Terminal) SetPosition(col int, line int) {
|
||||||
terminal.position = position
|
terminal.position = Position{
|
||||||
|
Col: col,
|
||||||
|
Line: line,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (terminal *Terminal) GetPosition() Position {
|
func (terminal *Terminal) GetPosition() Position {
|
||||||
|
@ -224,7 +225,7 @@ func (terminal *Terminal) Clear() {
|
||||||
for i := 0; i < int(terminal.size.Height); i++ {
|
for i := 0; i < int(terminal.size.Height); i++ {
|
||||||
terminal.lines = append(terminal.lines, NewLine())
|
terminal.lines = append(terminal.lines, NewLine())
|
||||||
}
|
}
|
||||||
terminal.SetPosition(Position{Line: 0, Col: 0})
|
terminal.SetPosition(0, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (terminal *Terminal) GetCellAtPos(pos Position) (*Cell, error) {
|
func (terminal *Terminal) GetCellAtPos(pos Position) (*Cell, error) {
|
||||||
|
|
Loading…
Reference in New Issue