mirror of
https://github.com/neovim/neovim.git
synced 2026-04-29 10:44:08 +00:00
fix(terminal): handle opening terminal on unloaded buffer (#37894)
Problem: Strange behavior when opening terminal on unloaded buffer.
Solution: For nvim_open_term() ensure the buffer is loaded as it needs
to be read into the terminal. For jobstart() just open the
memfile as the file content isn't needed.
Not going to make nvim_open_term() pass stdin to the terminal when stdin
isn't read into a buffer yet, as other APIs don't read stdin on unloaded
buffer either. There are also other problems with loading buffer before
reading stdin, so it's better to address those in another PR.
This commit is contained in:
@@ -49,7 +49,7 @@
|
||||
#include "api/buffer.c.generated.h"
|
||||
|
||||
/// Ensures that a buffer is loaded.
|
||||
static buf_T *api_buf_ensure_loaded(Buffer buffer, Error *err)
|
||||
buf_T *api_buf_ensure_loaded(Buffer buffer, Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
if (!buf) {
|
||||
|
||||
Reference in New Issue
Block a user