From 66360675cf4d091b7460e4a8e1435c13216c1929 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 11 Sep 2022 17:12:44 +0200 Subject: build: allow IWYU to fix includes for all .c files Allow Include What You Use to remove unnecessary includes and only include what is necessary. This helps with reducing compilation times and makes it easier to visualise which dependencies are actually required. Work on https://github.com/neovim/neovim/issues/549, but doesn't close it since this only works fully for .c files and not headers. --- src/nvim/runtime.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/nvim/runtime.h') diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h index 053c71212e..d40bb6c1c1 100644 --- a/src/nvim/runtime.h +++ b/src/nvim/runtime.h @@ -3,10 +3,15 @@ #include +#include "klib/kvec.h" #include "nvim/autocmd.h" #include "nvim/eval/typval.h" +#include "nvim/eval/typval_defs.h" #include "nvim/ex_cmds_defs.h" #include "nvim/ex_eval_defs.h" +#include "nvim/garray.h" +#include "nvim/pos.h" +#include "nvim/types.h" typedef enum { ETYPE_TOP, ///< toplevel -- cgit From 1aad5af637b0fc042e1155cc0955931e9ca75295 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 2 Dec 2022 20:44:26 +0800 Subject: vim-patch:8.2.3829: no error when setting a func option to script-local function Problem: No error when setting a func option to a script-local function. Solution: Give an error if the name starts with "s:". (closes vim/vim#9358) https://github.com/vim/vim/commit/94c785d235dccacf6cdf38c5903115b61ca8a981 Omit test: reverted in patch 8.2.3838. Cherry-pick SCRIPT_ID_VALID from patch 8.2.1539. Co-authored-by: Bram Moolenaar --- src/nvim/runtime.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/runtime.h') diff --git a/src/nvim/runtime.h b/src/nvim/runtime.h index d40bb6c1c1..de363020f8 100644 --- a/src/nvim/runtime.h +++ b/src/nvim/runtime.h @@ -79,6 +79,7 @@ typedef struct scriptitem_S { /// Growarray to store info about already sourced scripts. extern garray_T script_items; #define SCRIPT_ITEM(id) (((scriptitem_T *)script_items.ga_data)[(id) - 1]) +#define SCRIPT_ID_VALID(id) ((id) > 0 && (id) <= script_items.ga_len) typedef void (*DoInRuntimepathCB)(char *, void *); -- cgit