respond to soft lint warnings

This commit is contained in:
Mikael Fangel 2023-04-04 22:49:22 +02:00 committed by Maas Lalani
parent 59e3457c98
commit 8102a3d10a
No known key found for this signature in database
GPG key ID: 5A6ED5CBF1A0A000
2 changed files with 5 additions and 5 deletions

View file

@ -48,7 +48,7 @@ func (m *model) ProcessText(msg tea.WindowSizeMsg) {
textStyle := lipgloss.NewStyle().Width(m.viewport.Width)
var text strings.Builder
// Determine max width of a line
// Determine max width of a line.
m.maxWidth = m.viewport.Width
if m.softWrap {
vpStyle := m.viewport.Style
@ -93,7 +93,7 @@ func (m model) KeyHandler(key tea.KeyMsg) (model, func() tea.Msg) {
m.content = m.origContent
m.search.Execute(&m)
// Trigger a view update to highlight the found matches
// Trigger a view update to highlight the found matches.
m.search.NextMatch(&m)
m.ProcessText(tea.WindowSizeMsg{Height: m.viewport.Height + 2, Width: m.viewport.Width})
} else {

View file

@ -31,7 +31,7 @@ func (s *search) Begin() {
s.input.Focus()
}
// Execute find all lines in the model with a match
// Execute find all lines in the model with a match.
func (s *search) Execute(m *model) {
defer s.Done()
if s.input.Value() == "" {
@ -94,7 +94,7 @@ func (s *search) NextMatch(m *model) {
}
}
// Only update if the match is not within the viewport
// Only update if the match is not within the viewport.
if line > m.viewport.YOffset+m.viewport.VisibleLineCount()-1 || line < m.viewport.YOffset {
m.viewport.SetYOffset(line)
}
@ -144,7 +144,7 @@ func (s *search) PrevMatch(m *model) {
}
}
// Only update if the match is not within the viewport
// Only update if the match is not within the viewport.
if line > m.viewport.YOffset+m.viewport.VisibleLineCount()-1 || line < m.viewport.YOffset {
m.viewport.SetYOffset(line)
}