mirror of
https://github.com/neovim/neovim.git
synced 2025-11-16 15:21:20 +00:00
feat(prompt): multiline prompt input #33371
Problem: Cannot enter multiline prompts in a buftype=prompt buffer. Solution: - Support shift+enter (`<s-enter>`) to start a new line in the prompt. - Pasting multiline text via OS paste, clipboard, "xp, etc. - A/I in editable region works as usual. - i/a/A/I outside of editable region moves cursor to end of current prompt. - Support undo/redo in prompt buffer. - Support o/O in prompt buffer. - Expose prompt location as `':` mark.
This commit is contained in:
@@ -878,6 +878,7 @@ static void free_buffer(buf_T *buf)
|
||||
clear_fmark(&buf->b_last_cursor, 0);
|
||||
clear_fmark(&buf->b_last_insert, 0);
|
||||
clear_fmark(&buf->b_last_change, 0);
|
||||
clear_fmark(&buf->b_prompt_start, 0);
|
||||
for (size_t i = 0; i < NMARKS; i++) {
|
||||
free_fmark(buf->b_namedm[i]);
|
||||
}
|
||||
@@ -2024,6 +2025,7 @@ buf_T *buflist_new(char *ffname_arg, char *sfname_arg, linenr_T lnum, int flags)
|
||||
buf->b_prompt_callback.type = kCallbackNone;
|
||||
buf->b_prompt_interrupt.type = kCallbackNone;
|
||||
buf->b_prompt_text = NULL;
|
||||
clear_fmark(&buf->b_prompt_start, 0);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user