diff options
Diffstat (limited to 'go/src/lib/statusline')
-rw-r--r-- | go/src/lib/statusline/prefix.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/go/src/lib/statusline/prefix.go b/go/src/lib/statusline/prefix.go new file mode 100644 index 0000000..9373410 --- /dev/null +++ b/go/src/lib/statusline/prefix.go @@ -0,0 +1,21 @@ +package statusline + +type prefix struct { + inner StatusLine + prefix string +} + +func Prefix(sl StatusLine, pfix string) StatusLine { + return &prefix{ + inner: sl, + prefix: pfix, + } +} + +func (sl *prefix) Put(line string) { + sl.inner.Put(sl.prefix+line) +} + +func (sl *prefix) End(keep bool) { + sl.inner.End(keep) +} |