api: allow open non-current buffer as terminal (+ xmas bonus)

vim.api.nvim_chan_send(vim.api.nvim_open_term(0), io.open("/path/to/smile.cat", "r"):read("*a"))
This commit is contained in:
Björn Linse
2020-12-20 16:52:01 +01:00
parent 097ec71bd8
commit ed08936987
8 changed files with 236 additions and 26 deletions

View File

@@ -10731,7 +10731,7 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
INTEGER_OBJ(pid), false, false, &err);
api_clear_error(&err);
channel_terminal_open(chan);
channel_terminal_open(curbuf, chan);
channel_create_event(chan, NULL);
}