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:
parent
c0c9727c80
commit
e49a4438b1
@ -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.
|
||||
|
@ -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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user