diff options
| author | Julian Hurst <julian.hurst@digdash.com> | 2025-03-25 14:28:27 +0100 |
|---|---|---|
| committer | Julian Hurst <julian.hurst@digdash.com> | 2025-03-25 14:28:27 +0100 |
| commit | 3e7d23ed8bc9afc4a28b03e64a0a49d928b619d2 (patch) | |
| tree | 012ae05834607518be237eced8b3edb1e9bf053d | |
| parent | 88d4ab2cb91d0bf6e599c8ccd937c4aa2c9f5ce6 (diff) | |
| parent | 97d55df16cbc076183c65f2041aaff184b586239 (diff) | |
| download | hare-tui-3e7d23ed8bc9afc4a28b03e64a0a49d928b619d2.tar.gz | |
Merge branch 'master' into nomem
| -rw-r--r-- | tui/widget/list/list.ha | 4 | ||||
| -rw-r--r-- | tui/widget/widget.ha | 7 |
2 files changed, 7 insertions, 4 deletions
diff --git a/tui/widget/list/list.ha b/tui/widget/list/list.ha index 3dbf124..0e9f272 100644 --- a/tui/widget/list/list.ha +++ b/tui/widget/list/list.ha @@ -44,10 +44,10 @@ style: *style, items: str...) (list | tty::error) = { let end = match (sz) { case let sz: tty::ttysize => - const rows = if (tsz.rows < sz.rows) tsz.rows - 1 else sz.rows; + const rows = if (tsz.rows < sz.rows) tsz.rows else sz.rows; yield rows; case void => - yield tsz.rows - 1; + yield tsz.rows; }; let end = end: int; diff --git a/tui/widget/widget.ha b/tui/widget/widget.ha index f7dc511..9167e65 100644 --- a/tui/widget/widget.ha +++ b/tui/widget/widget.ha @@ -1,4 +1,4 @@ -use tui; +se tui; use fmt; use unix::tty; use io; @@ -185,7 +185,10 @@ export fn print(w: *widget) void = { yield strings::dup(sstyle[i]); }; defer free(line); - memio::concat(&st, line, NEWLINE)!; + memio::concat(&st, line)!; + if (i < len(sstyle) - 1) { + memio::concat(&st, NEWLINE)!; + }; }; const joined = memio::string(&st)!; |
