diff options
author | cflip <cflip@cflip.net> | 2023-01-31 13:31:21 -0700 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2023-01-31 14:00:17 -0700 |
commit | 1b8261071ef3ad3b8d1c2db6e712b0e590c563b3 (patch) | |
tree | ca7e8528b37ccd1d7748b5c70582239b506f8b6a /editor.h | |
parent | 264c4186ed8e3d2e3275a6514c8714903036cb26 (diff) |
Now there there is a new way to prompt for text, we can reimplement the
long abandoned editor_prompt function and use it to allow saving to new
files.
The new editor_prompt function takes a callback that will be called
after the user presses enter on the prompt.
Diffstat (limited to 'editor.h')
-rw-r--r-- | editor.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -36,11 +36,14 @@ struct editor_state { struct textbuf cmdline; }; +typedef void (*prompt_callback_t)(struct editor_state*, char*, size_t); + void init_editor(struct editor_state* editor); void editor_set_status_message(struct editor_state* editor, const char* format, ...); -char* editor_prompt(struct editor_state* editor, char* prompt, void (*callback)(struct editor_state*, char*, int)); +void editor_prompt(struct editor_state* editor, char* prompt, prompt_callback_t callback); void editor_run_command(struct editor_state *editor); +void editor_try_save(struct editor_state *editor); void editor_try_quit(struct editor_state *editor); void editor_move_left(struct editor_state *); |