|
@@ -36,6 +36,7 @@ func (l *Line) Output() string {
|
|
|
//
|
|
|
// Sample RenderF function
|
|
|
// Upcase is BOLD Blue, everything else is Yellow
|
|
|
+/*
|
|
|
func Render_BlueYellow(text string) string {
|
|
|
var output string
|
|
|
var lastColor string
|
|
@@ -60,6 +61,7 @@ func Render_BlueYellow(text string) string {
|
|
|
}
|
|
|
return output
|
|
|
}
|
|
|
+*/
|
|
|
|
|
|
type Render struct {
|
|
|
Line string
|
|
@@ -73,7 +75,13 @@ func (r *Render) Append(color string, len int) {
|
|
|
r.LastColor = color
|
|
|
r.Result += color
|
|
|
}
|
|
|
- r.Result += r.Line[r.Pos : r.Pos+len]
|
|
|
+
|
|
|
+ if Unicode {
|
|
|
+ // Treat unicode as []rune.
|
|
|
+ r.Result += string([]rune(r.Line)[r.Pos : r.Pos+len])
|
|
|
+ } else {
|
|
|
+ r.Result += r.Line[r.Pos : r.Pos+len]
|
|
|
+ }
|
|
|
r.Pos += len
|
|
|
}
|
|
|
|