чување 5ec297c54c244575a1fa66e9a24e14e988ccdda1
родитељ e03a0483ff09c920327af0f84a54d880c1eca0b5
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Wed, 19 Jun 2024 13:30:19 +0200
Bugfix: pressing Esc in save prompt when quitting should cancel instead of
exiting
Diffstat:
измењених датотека: 3, додавања: 5(+), брисања: 4(-)
diff --git a/TODO b/TODO
@@ -1,9 +1,6 @@
TODO
====
-[ ] Investigate: pressing Esc in save prompt should do nothing instead of
- exiting
-
< > Make allocation errors prompt to save the file before exiting?
- Would this make sense?
diff --git a/TODO.done b/TODO.done
@@ -1,6 +1,10 @@
Done or canceled todos
======================
+[x] Investigate: pressing Esc in save prompt should do nothing instead of
+ exiting
+ - Fixed; strchr(str, chr) returns a non-NULL pointer for ch == 0
+
[x] Make y/n prompts case-insensitive
[x] Investigate: paste text longer than a line, then type in the middle
diff --git a/sled.c b/sled.c
@@ -690,7 +690,7 @@ handle_key_event(struct tb_event* ev, struct DrawState* state)
if (IN(state->mode, M_PROMPT))
{
- if (strchr("YyNn", ev->ch))
+ if (ev->ch && strchr("YyNn", ev->ch))
{
if (state->prompt_callback)
state->prompt_callback(state, ev);