Skip to content

Commit

Permalink
fix for lint
Browse files Browse the repository at this point in the history
  • Loading branch information
szktkfm committed Jan 21, 2024
1 parent aad6e97 commit e09e006
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion list.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (d itemDelegate) Render(w io.Writer, m list.Model, index int, listItem list
return
}

str := CleanString(fmt.Sprintf("%s", i))
str := CleanString(string(i))

var fn func(strs ...string) string
if index == m.Index() {
Expand Down
5 changes: 1 addition & 4 deletions textinput.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sptui

import (
"fmt"
"strings"

"github.com/charmbracelet/bubbles/textinput"
Expand Down Expand Up @@ -56,9 +55,7 @@ func (m TextModel) UpdateText(msg tea.Msg) (TextModel, tea.Cmd) {
func (m TextModel) ViewText(textMode int) string {
pad := strings.Repeat(" ", padding)
if textMode == INPUT || textMode == ERROR {
return pad + fmt.Sprintf(
m.textInput.View(),
)
return pad + m.textInput.View()
}
return ""
}
3 changes: 1 addition & 2 deletions util.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package sptui

import (
"fmt"
"strings"

"github.com/mattn/go-runewidth"
Expand Down Expand Up @@ -61,7 +60,7 @@ func WrapText(s string, width int, line int) string {

func PadOrTruncate(s string, n int) string {
if runewidth.StringWidth(s) > listWidth {
return fmt.Sprintf("%s", runewidth.Truncate(s, n, ""))
return runewidth.Truncate(s, n, "")
} else {
return s + strings.Repeat(" ", listWidth-runewidth.StringWidth(s))
}
Expand Down

0 comments on commit e09e006

Please sign in to comment.