Add status bar

This commit is contained in:
Luke I. Wilson
2021-03-19 21:57:49 -05:00
parent 70d734e8e2
commit 6e97e8345a
2 changed files with 36 additions and 8 deletions

View File

@ -241,11 +241,6 @@ func (t *TextEdit) insertNewLine() {
t.prevCurCol = t.curx
}
// GetLineCol returns (line, col) of the cursor. Zero is origin for both.
func (t *TextEdit) GetLineCol() (int, int) {
return t.cury, t.curx
}
// getTabCountInLineAtCol returns tabs in the given line, at or before that column position,
// if hard tabs are enabled. If hard tabs are not enabled, the function returns zero.
// Multiply returned tab count by TabSize to get the offset produced by tabs.
@ -280,6 +275,11 @@ func (t *TextEdit) clampLineCol(line, col int) (int, int) {
return line, col
}
// GetLineCol returns (line, col) of the cursor. Zero is origin for both.
func (t *TextEdit) GetLineCol() (int, int) {
return t.cury, t.curx
}
// SetLineCol sets the cursor line and column position. Zero is origin for both.
// If `line` is out of bounds, `line` will be clamped to the closest available line.
// If `col` is out of bounds, `col` will be clamped to the closest column available for the line.