summaryrefslogtreecommitdiff
path: root/editor.h
diff options
context:
space:
mode:
authorcflip <cflip@cflip.net>2023-01-31 10:46:21 -0700
committercflip <cflip@cflip.net>2023-01-31 12:20:03 -0700
commit757efb85045408e2601da0f53547941a40d2e960 (patch)
tree0ab46da5222222971d3dd4bd7319262c6842be8a /editor.h
parentc3da108c2d41853beb49a90a1f43a2a9a158c385 (diff)
Start implementing editor commands
This first step allows you to press the semicolon key to enter command mode, where you can type into a command line. Currently, pressing enter when in command mode will clear the command line but since there are no commands implemented it doesn't matter what you type in there.
Diffstat (limited to 'editor.h')
-rw-r--r--editor.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/editor.h b/editor.h
index 00695fe..52daa06 100644
--- a/editor.h
+++ b/editor.h
@@ -33,12 +33,14 @@ struct editor_state {
* letter will be inserted when entering insert mode.
*/
int pressed_insert_key;
+ struct textbuf cmdline;
};
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_run_command(struct editor_state *editor);
void editor_try_quit(struct editor_state *editor);
void editor_move_left(struct editor_state *);