mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 20:56:17 +00:00
Update viewport/viewport.go
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
co-authored by
Carlos Alexandro Becker
parent
143ea4305b
commit
f1307e54de
@@ -134,16 +134,15 @@ func (m Model) visibleLines() (lines []string) {
|
||||
lines = m.lines[top:bottom]
|
||||
}
|
||||
|
||||
if m.indent > 0 {
|
||||
cutLines := make([]string, len(lines))
|
||||
for i := range lines {
|
||||
cutLines[i] = ansi.TruncateLeft(lines[i], m.indent, "")
|
||||
cutLines := make([]string, len(lines))
|
||||
for i, line := range lines {
|
||||
if m.indent > 0 {
|
||||
line = ansi.TruncateLeft(line, m.indent, "")
|
||||
}
|
||||
|
||||
return cutLines
|
||||
line = ansi.Truncate(line, m.Width, "")
|
||||
cutLines[i] = line
|
||||
}
|
||||
|
||||
return lines
|
||||
return cutLines
|
||||
}
|
||||
|
||||
// scrollArea returns the scrollable boundaries for high performance rendering.
|
||||
|
||||
Reference in New Issue
Block a user