Skip to content
This repository has been archived by the owner on Nov 26, 2023. It is now read-only.

Commit

Permalink
fix |sort error handling.
Browse files Browse the repository at this point in the history
fixes #21
  • Loading branch information
fiatjaf committed Sep 2, 2020
1 parent 71a96b8 commit 3d6a104
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,13 @@ func (e *Engine) getContents(prevContents []string) []string {
if err == nil {
return strings.Split("\n"+cc, "\n")
} else {
errorline := []string{cc}
if newline := strings.Index(cc, "\n"); newline != -1 {
errorline = []string{cc[0:newline]}
}

return append(
strings.Split(cc[0:strings.Index(cc, "\n")], "\n"),
errorline,
prevContents[1:]...,
)
}
Expand Down

0 comments on commit 3d6a104

Please sign in to comment.