mirror of
https://github.com/felixangell/phi.git
synced 2024-10-05 20:27:17 +03:00
fixed buffer rendering bug
this bug was causing the editor to crash when the command palette is opened if there are no buffers open.
This commit is contained in:
parent
454068ff05
commit
9777cb0336
@ -1398,8 +1398,10 @@ func (b *Buffer) renderAt(ctx *strife.Renderer, rx int, ry int) {
|
||||
for lineNum, rope := range b.table.Lines[start:upper] {
|
||||
currLine := []rune(rope.String())
|
||||
|
||||
// slice the visible characters only.
|
||||
currLine = currLine[:min(visibleChars, len(currLine))]
|
||||
if visibleChars >= 0 {
|
||||
// slice the visible characters only.
|
||||
currLine = currLine[:min(visibleChars, len(currLine))]
|
||||
}
|
||||
|
||||
// char index => colour
|
||||
var matches map[int]syntaxRuneInfo
|
||||
|
Loading…
Reference in New Issue
Block a user