1
0
mirror of https://github.com/mum4k/termdash.git synced 2025-05-01 22:17:51 +08:00

Fixing lint issues.

This commit is contained in:
Jakub Sobon 2019-04-20 17:37:45 -04:00
parent c0c9727c80
commit e49a4438b1
No known key found for this signature in database
GPG Key ID: F2451A77FB05D3B7
2 changed files with 6 additions and 4 deletions

View File

@ -362,11 +362,13 @@ func (fe *fieldEditor) reset() {
// insert inserts the rune at the current position of the cursor.
func (fe *fieldEditor) insert(r rune) {
if runewidth.RuneWidth(r) == 0 {
rw := runewidth.RuneWidth(r)
if rw == 0 {
// Don't insert invisible runes.
return
}
fe.data.insertAt(fe.curDataPos, r)
fe.curDataPos++
fe.curDataPos += rw
}
// delete deletes the rune at the current position of the cursor.

View File

@ -86,10 +86,10 @@ var (
// textFieldRune is the rune used in cells reserved for the text input
// field if no text is present.
// Changed from tests to provide readable test failures.
textFieldRune rune = 0
textFieldRune rune
// cursorRune is rune that represents the cursor position.
cursorRune rune = 0
cursorRune rune
)
// Read reads the content of the text input field.