fixed seg fault, try not to match conflicts

This commit is contained in:
Felix Angell 2018-04-15 22:10:05 +01:00
parent 112cdc74d6
commit 0ac9aff112
3 changed files with 6 additions and 3 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
glew.h
tests/
phi-editor
fmt.sh

View File

@ -786,7 +786,7 @@ func (b *Buffer) renderAt(ctx *strife.Renderer, rx int, ry int) {
if strings.Compare(string(a), subject) == 0 {
for i := 0; i < len(subject); i++ {
if _, ok := matches[i+idx]; ok {
continue
break
}
matches[i+idx] = colours[syntaxIndex]
}

View File

@ -48,7 +48,10 @@ func CloseBuffer(b *Buffer) bool {
i = i + 1
lastBuffer = p.(*Buffer)
}
lastBuffer.HasFocus = true
if lastBuffer != nil {
lastBuffer.HasFocus = true
}
return true
}