Skip to content

Commit 70c18d4

Browse files
refactor(cli): update user input function
1 parent 9cc225e commit 70c18d4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/cli/cli.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ fn draw(self: *CLI) !void {
203203

204204
fn userInput(self: *CLI) !void {
205205
while (true) {
206-
207-
// TODO: multi threading
208-
// TODO: non blocking IO
209206
const INPUT = try STDIN.takeDelimiterExclusive('\n');
210207

211208
if (STD.mem.eql(u8, INPUT, "n")) {
@@ -230,7 +227,10 @@ fn userInput(self: *CLI) !void {
230227
}
231228

232229
// TODO: reset using diff and patches
233-
if (STD.mem.eql(u8, INPUT, "x")) {}
230+
if (STD.mem.eql(u8, INPUT, "x")) {
231+
try clear(self);
232+
try draw(self);
233+
}
234234

235235
if (STD.mem.eql(u8, INPUT, "q")) {
236236
try clear(self);

0 commit comments

Comments
 (0)