aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--handlers.ha10
-rwxr-xr-xilharebin0 -> 814992 bytes
-rw-r--r--main.ha10
3 files changed, 10 insertions, 10 deletions
diff --git a/handlers.ha b/handlers.ha
index e73dca0..adefe89 100644
--- a/handlers.ha
+++ b/handlers.ha
@@ -74,7 +74,7 @@ fn runehandler(l: *widget::widget, r: libtui::key) bool = {
fmt::printf("{}{}", s, termchar)!;
case let s: []str =>
defer free(s);
- const out = strings::join(termchar, s...);
+ const out = strings::join(termchar, s...)!;
defer free(out);
fmt::printf("{}{}", out, termchar)!;
};
@@ -155,7 +155,7 @@ fn runehandler(l: *widget::widget, r: libtui::key) bool = {
defer strings::freeall(newitems);
for (let i = 0z; i < len(l.items); i += 1) {
if (strings::contains(l.items[i], strings::fromutf8(line)!)) {
- append(newitems, l.items[i]);
+ append(newitems, l.items[i])!;
};
};
list::setitems(l, newitems...);
@@ -163,11 +163,11 @@ fn runehandler(l: *widget::widget, r: libtui::key) bool = {
case 'o' =>
// order
list::clearmarked(l);
- sort::sort(l.items, size(str), &sort::cmp::strs);
+ sort::sort(l.items, size(str), &sort::cmp::strs)!;
case 'O' =>
// reverse order
list::clearmarked(l);
- sort::sort(l.items, size(str), &sort::cmp::strs);
+ sort::sort(l.items, size(str), &sort::cmp::strs)!;
reverse(l.items);
case 'p' =>
strings::freeall(l.items);
@@ -254,7 +254,7 @@ fn runehandler(l: *widget::widget, r: libtui::key) bool = {
fmt::printf("{}{}", s, termchar)!;
case let s: []str =>
defer free(s);
- const out = strings::join(termchar, s...);
+ const out = strings::join(termchar, s...)!;
defer free(out);
fmt::printf("{}{}", out, termchar)!;
};
diff --git a/ilhare b/ilhare
new file mode 100755
index 0000000..23ce049
--- /dev/null
+++ b/ilhare
Binary files differ
diff --git a/main.ha b/main.ha
index 552ceae..297970c 100644
--- a/main.ha
+++ b/main.ha
@@ -91,7 +91,7 @@ fn handle_print(loop: *ev::loop, user: nullable *opaque) void = {
fmt::fprintln(os::stderr, tty::strerror(e))!;
ev::stop(loop);
};
- ev::do(loop, &handle_print, st);
+ ev::do(loop, &handle_print, st)!;
};
export fn main() void = {
@@ -111,7 +111,7 @@ export fn main() void = {
case 'm' =>
msg = opt.1;
case 's' =>
- searchterm = strings::dup(opt.1);
+ searchterm = strings::dup(opt.1)!;
case =>
yield;
};
@@ -126,8 +126,8 @@ export fn main() void = {
defer free(in);
let sin = strings::fromutf8(in)!;
sin = strings::trim(sin, '\n');
- let items = strings::split(sin, "\n"); // freed by list::finish
- itemscopy = strings::dupall(items);
+ let items = strings::split(sin, "\n")!; // freed by list::finish
+ itemscopy = strings::dupall(items)!;
defer strings::freeall(itemscopy);
let ui = libtui::init();
@@ -170,7 +170,7 @@ export fn main() void = {
let mainf = ev::register(&loop, ui.f, &st)!;
ev::readable(mainf, &handle_ui);
- ev::do(&loop, &handle_print, &st);
+ ev::do(&loop, &handle_print, &st)!;
for (ev::dispatch(&loop, -1)!) {
void;