summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor.c6
-rw-r--r--editor.h2
-rw-r--r--input.c6
-rw-r--r--window.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/editor.c b/editor.c
index c4e2a06..8e0f6a6 100644
--- a/editor.c
+++ b/editor.c
@@ -188,8 +188,8 @@ void editor_set_mode(struct editor_state *editor, enum editor_mode mode)
if (mode == last_mode)
return;
- /* Clear the command line if we are leaving command mode. */
- if (last_mode == EDITOR_MODE_COMMAND) {
+ /* Clear the command line if we are leaving prompt mode. */
+ if (last_mode == EDITOR_MODE_PROMPT) {
textbuf_clear(&editor->cmdline);
}
@@ -334,7 +334,7 @@ void editor_draw_message_bar(struct editor_state* editor, struct textbuf *buffer
return;
}
- if (editor->mode == EDITOR_MODE_COMMAND) {
+ if (editor->mode == EDITOR_MODE_PROMPT) {
textbuf_append(buffer, editor->cmdline.buffer, editor->cmdline.length);
return;
}
diff --git a/editor.h b/editor.h
index 0ae0fae..e530956 100644
--- a/editor.h
+++ b/editor.h
@@ -9,7 +9,7 @@
enum editor_mode {
EDITOR_MODE_NORMAL,
EDITOR_MODE_INSERT,
- EDITOR_MODE_COMMAND
+ EDITOR_MODE_PROMPT
};
struct editor_state {
diff --git a/input.c b/input.c
index 3167a91..c695cb9 100644
--- a/input.c
+++ b/input.c
@@ -14,7 +14,7 @@ void input_process_textinput(struct editor_state *editor, const char *text)
if (editor->mode == EDITOR_MODE_INSERT) {
editor_insert_char(editor, *text);
- } else if (editor->mode == EDITOR_MODE_COMMAND) {
+ } else if (editor->mode == EDITOR_MODE_PROMPT) {
textbuf_append(&editor->cmdline, text, 1);
}
}
@@ -37,7 +37,7 @@ void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym)
return;
}
- if (editor->mode == EDITOR_MODE_COMMAND) {
+ if (editor->mode == EDITOR_MODE_PROMPT) {
if (keysym->sym == SDLK_BACKSPACE)
textbuf_delete(&editor->cmdline);
@@ -106,7 +106,7 @@ void editor_process_keypress(struct editor_state *editor, SDL_Keysym *keysym)
break;
case SDLK_SEMICOLON:
if (keysym->mod & KMOD_SHIFT)
- editor_set_mode(editor, EDITOR_MODE_COMMAND);
+ editor_set_mode(editor, EDITOR_MODE_PROMPT);
break;
}
}
diff --git a/window.c b/window.c
index cb041e5..8f08f39 100644
--- a/window.c
+++ b/window.c
@@ -157,7 +157,7 @@ void window_redraw(struct editor_state *editor)
int cursor_x = (editor->cursor_display_x - editor->col_offset);
int cursor_y = (editor->cursor_y - editor->line_offset);
- if (editor->mode == EDITOR_MODE_COMMAND) {
+ if (editor->mode == EDITOR_MODE_PROMPT) {
cursor_x = editor->cmdline.length;
cursor_y = editor->screen_rows + 1;
}