summaryrefslogtreecommitdiff
path: root/tui/widget/text/text.ha
diff options
context:
space:
mode:
Diffstat (limited to 'tui/widget/text/text.ha')
-rw-r--r--tui/widget/text/text.ha9
1 files changed, 5 insertions, 4 deletions
diff --git a/tui/widget/text/text.ha b/tui/widget/text/text.ha
index 0a30eb0..40b3f58 100644
--- a/tui/widget/text/text.ha
+++ b/tui/widget/text/text.ha
@@ -2,7 +2,6 @@ use io;
use unix::tty;
use tui;
use tui::widget;
-use strings;
export type text = struct {
widget: widget::widget,
@@ -19,7 +18,7 @@ export fn newtext(state: *tui::tui, txt: str, pos: widget::coords, style: (*widg
pos = pos,
sz = void,
style = style,
- damage = widget::all,
+ damage = widget::damageall,
...
},
txt = txt,
@@ -28,8 +27,10 @@ export fn newtext(state: *tui::tui, txt: str, pos: widget::coords, style: (*widg
fn printtext(widget: *widget::widget) void = {
const widget = widget: *text;
- widget.widget.buf = strings::dup(widget.txt);
- defer free(widget.widget.buf);
+ widget.widget.buf = widget::linesbuf {
+ lines = [widget.txt],
+ ...
+ };
widget::print(widget);
};