Handle untimestamped text view lines
This commit is contained in:
committed by
Brandon McGinty
parent
214ccb8787
commit
0e9e495a8f
+5
-2
@@ -84,8 +84,11 @@ func (t *Textview) updateParsedLines() {
|
|||||||
parsed := make([]string, 0, len(t.Lines))
|
parsed := make([]string, 0, len(t.Lines))
|
||||||
for _, line := range t.Lines {
|
for _, line := range t.Lines {
|
||||||
var l = line
|
var l = line
|
||||||
if t.showTimestamps == false {
|
if !t.showTimestamps {
|
||||||
l = strings.TrimSpace(strings.Split(line, "]")[1])
|
// Server and local messages need not have a timestamp prefix.
|
||||||
|
if _, text, ok := strings.Cut(line, "]"); ok {
|
||||||
|
l = strings.TrimSpace(text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
current := ""
|
current := ""
|
||||||
chars := 0
|
chars := 0
|
||||||
|
|||||||
Reference in New Issue
Block a user