diff --git a/cmd/root.go b/cmd/root.go index d61a251..509c3a7 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -73,7 +73,7 @@ Find document on: https://github.com/zu1k/nali if line == "quit" || line == "exit" { return } - _, _ = fmt.Fprintf(color.Output, "%s\n", entity.ParseLine(line).ColorString()) + _, _ = fmt.Fprintf(color.Output, "%s", entity.ParseLine(line).ColorString()) } } else { _, _ = fmt.Fprintf(color.Output, "%s\n", entity.ParseLine(strings.Join(args, " ")).ColorString()) diff --git a/pkg/common/scan.go b/pkg/common/scan.go index 08d2e90..476dbdc 100644 --- a/pkg/common/scan.go +++ b/pkg/common/scan.go @@ -17,7 +17,7 @@ func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) { if i+1 < len(data) && data[i] == '\r' && data[i+1] == '\n' { delimiterLen = 2 } - return i + delimiterLen, data[:i], nil + return i + delimiterLen, data[:i+delimiterLen], nil } // If we're at EOF, we have a final, non-terminated line. Return it. if atEOF {