diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2014-10-24 23:39:37 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2014-10-24 23:39:37 +0200 |
| commit | 1ff146d3c256782ad976913739a3fef7b57b3fb3 (patch) | |
| tree | 2c47e9f9f5dcf52107fe394174e03ada922886e7 /editor.c | |
| parent | c1d69b6067c896a56fa55c1fdb299cc78065d920 (diff) | |
| download | vis-1ff146d3c256782ad976913739a3fef7b57b3fb3.tar.gz vis-1ff146d3c256782ad976913739a3fef7b57b3fb3.tar.xz | |
Make command prompt available in visual modes
Diffstat (limited to 'editor.c')
| -rw-r--r-- | editor.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -511,15 +511,17 @@ static void editor_prompt_move(Prompt *prompt, int x, int y) { editor_window_move(prompt->win, x + title_width, y); } -void editor_prompt_show(Editor *ed, const char *title) { +void editor_prompt_show(Editor *ed, const char *title, const char *text) { Prompt *prompt = ed->prompt; if (prompt->active) return; prompt->active = true; prompt->editor = ed->win; - ed->win = prompt->win; free(prompt->title); prompt->title = strdup(title); + text_insert(prompt->win->text, 0, text, strlen(text)); + window_cursor_to(prompt->win->win, text_size(prompt->win->text)); + ed->win = prompt->win; editor_resize(ed, ed->width, ed->height); } |
