vim-patch:8.1.1584: the evalfunc.c file is getting too big

Problem:    The evalfunc.c file is getting too big.
Solution:   Move channel and job related functions to channel.c.

0a1f56fcfe

---

N/A patches below:

vim-patch:8.1.0770: inconsistent use of ELAPSED_FUNC

Problem:    Inconsistent use of ELAPSED_FUNC.
Solution:   Consistently use ELAPSED_FUNC.  Also turn ELAPSED_TYPE into a
            typedef. (Ozaki Kiichi, closes vim/vim#3815)

1ac56c2d11

vim-patch:8.1.0914: code related to findfile() is spread out

Problem:    Code related to findfile() is spread out.
Solution:   Put findfile() related code into a new source file. (Yegappan
            Lakshmanan, closes vim/vim#3934)

5fd0f5052f

vim-patch:8.1.1004: function "luaV_setref()" not covered with tests

Problem:    Function "luaV_setref()" not covered with tests.
Solution:   Add a test. (Dominique Pelle, closes vim/vim#4089)

e165f63598

vim-patch:8.1.1551: warning for shadowing popup_dragwin

Problem:    Warning for shadowing popup_dragwin. (Dominique Pelle)
Solution:   Add missing change.

6c17543b56

vim-patch:8.1.1629: terminal function help is in the wrong file

Problem:    Terminal function help is in the wrong file.
Solution:   Move the function details to terminal.txt.

6bf2c6264b

vim-patch:8.1.1641: garbage collection may run at a wrong moment

Problem:    Garbage collection may run at a wrong moment. (Trygve Aaberge)
Solution:   Postpone garbage collection while parsing messages. (closes vim/vim#4620)

6cc7e21412

vim-patch:8.1.1703: breaking out of loop by checking window pointer insufficient

Problem:    Breaking out of loop by checking window pointer is insufficient.
Solution:   Check the window ID and the buffer number. (closes vim/vim#4683)

6138640806

vim-patch:8.1.1802: missing change to call_callback()

Problem:    Missing change to call_callback().
Solution:   Add missing change.

b2129068a5

vim-patch:8.1.1853: timers test is still flaky

Problem:    Timers test is still flaky.
Solution:   Compute the time to sleep more accurately.

52953194af

---
Seems N/A now because of commit 09370eae77
---

vim-patch:8.1.2200: crash when memory allocation fails

Problem:    Crash when memory allocation fails.
Solution:   Check for NULL curwin and curbuf. (Christian Brabandt,
            closes vim/vim#4839)

1cac70953d

vim-patch:8.2.3922: cannot build with dynamic Ruby 3.1

Problem:    Cannot build with dynamic Ruby 3.1.
Solution:   Add "_EXTRA" variables for CI.  Add missing functions. (Ozaki
            Kiichi, closes vim/vim#9420)

8bb3fe4d4d

vim-patch:9.0.0546: supporting Ruby 1.8 makes code complicated

Problem:    Supporting Ruby 1.8 makes code complicated.
Solution:   Drop Ruby 1.8 support, it is ancient. (Ken Takata, closes vim/vim#11195)

236ccbf6f8

vim-patch:9.0.0928: using Ruby LDFLAGS may cause build problems

Problem:    Using Ruby LDFLAGS may cause build problems.
Solution:   Do not add Ruby LDFLAGS to Vim's LDFLAGS. (Zdenek Dohnal,
            closes vim/vim#11592)

1d822afaf6

vim-patch:9.1.1382: if_ruby: unused compiler warnings from ruby internals

Problem:  if_ruby: unused compiler warnings from ruby internals
Solution: disable -Wunused-parameter for if_ruby internal code
          (Philip H.)

closes: vim/vim#17297

411730e277

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-07-12 00:17:45 -04:00
parent 00c2e7d89c
commit 4765d4e059
2 changed files with 64 additions and 62 deletions

View File

@@ -17,6 +17,7 @@
#include "nvim/errors.h"
#include "nvim/eval.h"
#include "nvim/eval/encode.h"
#include "nvim/eval/funcs.h"
#include "nvim/eval/typval.h"
#include "nvim/event/loop.h"
#include "nvim/event/multiqueue.h"
@@ -24,6 +25,7 @@
#include "nvim/event/rstream.h"
#include "nvim/event/socket.h"
#include "nvim/event/wstream.h"
#include "nvim/ex_cmds.h"
#include "nvim/garray.h"
#include "nvim/gettext_defs.h"
#include "nvim/globals.h"
@@ -1001,3 +1003,65 @@ Array channel_all_info(Arena *arena)
}
return ret;
}
/// "prompt_setcallback({buffer}, {callback})" function
void f_prompt_setcallback(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
Callback prompt_callback = { .type = kCallbackNone };
if (check_secure()) {
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
if (argvars[1].v_type != VAR_STRING || *argvars[1].vval.v_string != NUL) {
if (!callback_from_typval(&prompt_callback, &argvars[1])) {
return;
}
}
callback_free(&buf->b_prompt_callback);
buf->b_prompt_callback = prompt_callback;
}
/// "prompt_setinterrupt({buffer}, {callback})" function
void f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
Callback interrupt_callback = { .type = kCallbackNone };
if (check_secure()) {
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
if (argvars[1].v_type != VAR_STRING || *argvars[1].vval.v_string != NUL) {
if (!callback_from_typval(&interrupt_callback, &argvars[1])) {
return;
}
}
callback_free(&buf->b_prompt_interrupt);
buf->b_prompt_interrupt = interrupt_callback;
}
/// "prompt_setprompt({buffer}, {text})" function
void f_prompt_setprompt(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
if (check_secure()) {
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
const char *text = tv_get_string(&argvars[1]);
xfree(buf->b_prompt_text);
buf->b_prompt_text = xstrdup(text);
}

View File

@@ -5241,52 +5241,6 @@ static void f_printf(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
}
}
/// "prompt_setcallback({buffer}, {callback})" function
static void f_prompt_setcallback(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
Callback prompt_callback = { .type = kCallbackNone };
if (check_secure()) {
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
if (argvars[1].v_type != VAR_STRING || *argvars[1].vval.v_string != NUL) {
if (!callback_from_typval(&prompt_callback, &argvars[1])) {
return;
}
}
callback_free(&buf->b_prompt_callback);
buf->b_prompt_callback = prompt_callback;
}
/// "prompt_setinterrupt({buffer}, {callback})" function
static void f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
Callback interrupt_callback = { .type = kCallbackNone };
if (check_secure()) {
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
if (argvars[1].v_type != VAR_STRING || *argvars[1].vval.v_string != NUL) {
if (!callback_from_typval(&interrupt_callback, &argvars[1])) {
return;
}
}
callback_free(&buf->b_prompt_interrupt);
buf->b_prompt_interrupt = interrupt_callback;
}
/// "prompt_getprompt({buffer})" function
static void f_prompt_getprompt(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
FUNC_ATTR_NONNULL_ALL
@@ -5307,22 +5261,6 @@ static void f_prompt_getprompt(typval_T *argvars, typval_T *rettv, EvalFuncData
rettv->vval.v_string = xstrdup(buf_prompt_text(buf));
}
/// "prompt_setprompt({buffer}, {text})" function
static void f_prompt_setprompt(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
{
if (check_secure()) {
return;
}
buf_T *buf = tv_get_buf(&argvars[0], false);
if (buf == NULL) {
return;
}
const char *text = tv_get_string(&argvars[1]);
xfree(buf->b_prompt_text);
buf->b_prompt_text = xstrdup(text);
}
/// "prompt_getinput({buffer})" function
static void f_prompt_getinput(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
FUNC_ATTR_NONNULL_ALL