Skip to content

Commit

Permalink
fix: lint issues
Browse files Browse the repository at this point in the history
Signed-off-by: Carlos Alexandro Becker <[email protected]>
  • Loading branch information
caarlos0 committed Sep 17, 2024
1 parent e06d2e6 commit 8c7abe7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pager/pager.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,15 @@ func (m *model) ProcessText(msg tea.WindowSizeMsg) {
text.WriteString(m.lineNumberStyle.Render(fmt.Sprintf("%4d │ ", i+1)))
}
for m.softWrap && lipgloss.Width(line) > m.maxWidth {
truncatedLine := truncate.String(line, uint(m.maxWidth))
truncatedLine := truncate.String(line, uint(m.maxWidth)) //nolint: gosec
text.WriteString(textStyle.Render(truncatedLine))
text.WriteString("\n")
if m.showLineNumbers {
text.WriteString(m.lineNumberStyle.Render(" │ "))
}
line = strings.Replace(line, truncatedLine, "", 1)
}
text.WriteString(textStyle.Render(truncate.String(line, uint(m.maxWidth))))
text.WriteString(textStyle.Render(truncate.String(line, uint(m.maxWidth)))) //nolint: gosec
text.WriteString("\n")
}

Expand Down
4 changes: 2 additions & 2 deletions pager/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ func softWrapEm(str string, maxWidth int, softWrap bool) string {
var text strings.Builder
for _, line := range strings.Split(str, "\n") {
for softWrap && lipgloss.Width(line) > maxWidth {
truncatedLine := truncate.String(line, uint(maxWidth))
truncatedLine := truncate.String(line, uint(maxWidth)) //nolint: gosec
text.WriteString(truncatedLine)
text.WriteString("\n")
line = strings.Replace(line, truncatedLine, "", 1)
}
text.WriteString(truncate.String(line, uint(maxWidth)))
text.WriteString(truncate.String(line, uint(maxWidth))) //nolint: gosec
text.WriteString("\n")
}

Expand Down

0 comments on commit 8c7abe7

Please sign in to comment.