refactor: move non-symbols in ex_eval.h to ex_eval_defs.h (#19739)

This avoids including ex_eval.h in any other header, thus preventing
future circular includes.
This commit is contained in:
zeertzjq
2022-08-12 19:16:24 +08:00
committed by GitHub
parent 1cf3a4b409
commit f79773a3b4
18 changed files with 110 additions and 95 deletions

View File

@@ -11,6 +11,7 @@
#include "nvim/api/private/helpers.h"
#include "nvim/autocmd.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/lua/executor.h"
#include "nvim/ops.h"
#include "nvim/regexp.h"

View File

@@ -19,6 +19,7 @@
#include "nvim/eval.h"
#include "nvim/eval/typval.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_eval.h"
#include "nvim/extmark.h"
#include "nvim/fileio.h"
#include "nvim/highlight_group.h"
@@ -54,7 +55,7 @@ void try_enter(TryState *const tstate)
// save_dbg_stuff()/restore_dbg_stuff().
*tstate = (TryState) {
.current_exception = current_exception,
.msg_list = (const struct msglist *const *)msg_list,
.msg_list = (const msglist_T *const *)msg_list,
.private_msg_list = NULL,
.trylevel = trylevel,
.got_int = got_int,
@@ -89,7 +90,7 @@ bool try_leave(const TryState *const tstate, Error *const err)
assert(msg_list == &tstate->private_msg_list);
assert(*msg_list == NULL);
assert(current_exception == NULL);
msg_list = (struct msglist **)tstate->msg_list;
msg_list = (msglist_T **)tstate->msg_list;
current_exception = tstate->current_exception;
trylevel = tstate->trylevel;
got_int = tstate->got_int;

View File

@@ -3,7 +3,7 @@
#include "nvim/api/private/defs.h"
#include "nvim/decoration.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_eval_defs.h"
#include "nvim/getchar.h"
#include "nvim/lib/kvec.h"
#include "nvim/memory.h"
@@ -130,8 +130,8 @@ EXTERN PMap(handle_T) tabpage_handles INIT(= MAP_INIT);
/// processed and that “other VimL code” must not be affected.
typedef struct {
except_T *current_exception;
struct msglist *private_msg_list;
const struct msglist *const *msg_list;
msglist_T *private_msg_list;
const msglist_T *const *msg_list;
int trylevel;
int got_int;
int need_rethrow;
@@ -144,8 +144,8 @@ typedef struct {
// TODO(bfredl): prepare error-handling at "top level" (nv_event).
#define TRY_WRAP(code) \
do { \
struct msglist **saved_msg_list = msg_list; \
struct msglist *private_msg_list; \
msglist_T **saved_msg_list = msg_list; \
msglist_T *private_msg_list; \
msg_list = &private_msg_list; \
private_msg_list = NULL; \
code \

View File

@@ -30,6 +30,7 @@
#include "nvim/ex_cmds2.h"
#include "nvim/ex_cmds_defs.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/file_search.h"
#include "nvim/fileio.h"
#include "nvim/getchar.h"