summaryrefslogtreecommitdiff
path: root/src/Editor.zig
diff options
context:
space:
mode:
authorGravatar Uko Kokņevičs2021-12-31 21:21:50 +0200
committerGravatar Uko Kokņevičs2021-12-31 21:21:50 +0200
commite6aae2d63a1e5ca9eb67977a4bc34b7ecea3d8a7 (patch)
tree019b1053f29a2ece5f5c153aab18b4ee597dddaa /src/Editor.zig
parentUpdate zig mode (diff)
downloades-e6aae2d63a1e5ca9eb67977a4bc34b7ecea3d8a7.tar.gz
es-e6aae2d63a1e5ca9eb67977a4bc34b7ecea3d8a7.tar.xz
es-e6aae2d63a1e5ca9eb67977a4bc34b7ecea3d8a7.zip
Fix a bug
Diffstat (limited to '')
-rw-r--r--src/Editor.zig8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Editor.zig b/src/Editor.zig
index 487c5ff..4d45b77 100644
--- a/src/Editor.zig
+++ b/src/Editor.zig
@@ -237,7 +237,13 @@ pub fn promptYN(self: *Editor, prompt_str: []const u8) !bool {
237 var response = try self.prompt(full_prompt); 237 var response = try self.prompt(full_prompt);
238 defer if (response) |str| self.allocator.free(str); 238 defer if (response) |str| self.allocator.free(str);
239 // TODO: This can be improved 239 // TODO: This can be improved
240 while (response == null or (response.?[0] != 'y' and response.?[0] != 'Y' and response.?[0] != 'n' and response.?[0] != 'N')) { 240 while (response == null
241 or response.?.len == 0
242 or (response.?[0] != 'y'
243 and response.?[0] != 'Y'
244 and response.?[0] != 'n'
245 and response.?[0] != 'N')
246 ) {
241 if (response) |str| self.allocator.free(str); 247 if (response) |str| self.allocator.free(str);
242 response = try self.prompt(full_prompt); 248 response = try self.prompt(full_prompt);
243 } 249 }