From c5322e752e9e568de907f7a1ef733bbfe342140c Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Fri, 26 Aug 2022 23:11:25 +0200 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/vim.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index ec8d6ab153..6c7bc05c82 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -205,7 +205,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) #define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n)) #define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n)) -#define STRCMP(d, s) strcmp((char *)(d), (char *)(s)) #define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n)) #ifdef HAVE_STRCASECMP # define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s)) -- cgit From 684bc749efef0fa31395d349f4495d79ec5f3fd5 Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Fri, 26 Aug 2022 23:11:25 +0200 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/vim.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 6c7bc05c82..af0f231b37 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -230,7 +230,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #endif #define STRCAT(d, s) strcat((char *)(d), (char *)(s)) // NOLINT(runtime/printf) -#define STRLCAT(d, s, n) xstrlcat((char *)(d), (char *)(s), (size_t)(n)) // Character used as separated in autoload function/variable names. #define AUTOLOAD_CHAR '#' @@ -245,23 +244,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #include "nvim/path.h" -/// Compare file names -/// -/// On some systems case in a file name does not matter, on others it does. -/// -/// @note Does not account for maximum name lengths and things like "../dir", -/// thus it is not 100% accurate. OS may also use different algorithm for -/// case-insensitive comparison. -/// -/// @param[in] x First file name to compare. -/// @param[in] y Second file name to compare. -/// -/// @return 0 for equal file names, non-zero otherwise. -#define FNAMECMP(x, y) path_fnamecmp((const char *)(x), (const char *)(y)) -#define FNAMENCMP(x, y, n) path_fnamencmp((const char *)(x), \ - (const char *)(y), \ - (size_t)(n)) - // Enums need a typecast to be used as array index. #define HL_ATTR(n) hl_attr_active[(int)(n)] -- cgit From 6d557e324fd4223fff3279a0112f40431c540163 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Sun, 18 Sep 2022 03:17:15 +0200 Subject: vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215) Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and others. Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the GUI build. (Hirohito Higashi, closes vim/vim#3932) https://github.com/vim/vim/commit/4f97475d326c2773a78561fb874e4f23c25cbcd9 --- src/nvim/vim.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index af0f231b37..5b7ff7ba52 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -256,7 +256,7 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // functions of these names. The declarations would break if the defines had // been seen at that stage. But it must be before globals.h, where error_ga // is declared. -#ifndef WIN32 +#ifndef MSWIN # define mch_errmsg(str) fprintf(stderr, "%s", (str)) # define mch_msg(str) printf("%s", (str)) #endif -- cgit From 288208257c8d6b3c8dcce7ee6c7b6c7bb7bafb27 Mon Sep 17 00:00:00 2001 From: Lewis Russell Date: Sat, 8 Oct 2022 15:48:07 +0100 Subject: feat(cscope)!: remove --- src/nvim/vim.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 5b7ff7ba52..4bcda9fc4f 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -138,7 +138,6 @@ enum { EXPAND_USER_LIST, EXPAND_USER_LUA, EXPAND_SHELLCMD, - EXPAND_CSCOPE, EXPAND_SIGN, EXPAND_PROFILE, EXPAND_BEHAVE, -- cgit 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/vim.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 4bcda9fc4f..7ac359da9a 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -1,7 +1,7 @@ #ifndef NVIM_VIM_H #define NVIM_VIM_H -#include "nvim/pos.h" // for linenr_T, MAXCOL, etc... +#include "nvim/pos.h" #include "nvim/types.h" // Some defines from the old feature.h -- cgit From bd22585061b66d7f71d4832b4a81e950b3c9d19d Mon Sep 17 00:00:00 2001 From: Dundar Göc Date: Fri, 26 Aug 2022 23:11:25 +0200 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/vim.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 7ac359da9a..50b186c750 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -195,7 +195,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // defines to avoid typecasts from (char_u *) to (char *) and back // (vim_strchr() is now in strings.c) -#define STRLEN(s) strlen((char *)(s)) #ifdef HAVE_STRNLEN # define STRNLEN(s, n) strnlen((char *)(s), (size_t)(n)) #else @@ -216,7 +215,7 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #endif // Like strcpy() but allows overlapped source and destination. -#define STRMOVE(d, s) memmove((d), (s), STRLEN(s) + 1) +#define STRMOVE(d, s) memmove((d), (s), strlen(s) + 1) #ifdef HAVE_STRNCASECMP # define STRNICMP(d, s, n) strncasecmp((char *)(d), (char *)(s), (size_t)(n)) -- cgit From 3b96ccf7d35be90e49029dec76344d3d92ad91dc Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sat, 26 Nov 2022 18:57:46 +0100 Subject: refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/vim.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 50b186c750..3a927d6a55 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -195,13 +195,11 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // defines to avoid typecasts from (char_u *) to (char *) and back // (vim_strchr() is now in strings.c) -#ifdef HAVE_STRNLEN -# define STRNLEN(s, n) strnlen((char *)(s), (size_t)(n)) -#else -# define STRNLEN(s, n) xstrnlen((char *)(s), (size_t)(n)) +#ifndef HAVE_STRNLEN +# define strnlen xstrnlen // Older versions of SunOS may not have strnlen #endif -#define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) -#define STRNCPY(d, s, n) strncpy((char *)(d), (char *)(s), (size_t)(n)) + +#define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) // NOLINT(runtime/printf) #define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n)) #define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n)) #ifdef HAVE_STRCASECMP -- cgit From 614d382621fa0b9d19287b63edb39b637409c581 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 16 Dec 2022 17:33:52 +0100 Subject: refactor: rename mch_msg => os_msg --- src/nvim/vim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 3a927d6a55..52af85ccc6 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -253,8 +253,8 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // been seen at that stage. But it must be before globals.h, where error_ga // is declared. #ifndef MSWIN -# define mch_errmsg(str) fprintf(stderr, "%s", (str)) -# define mch_msg(str) printf("%s", (str)) +# define os_errmsg(str) fprintf(stderr, "%s", (str)) +# define os_msg(str) printf("%s", (str)) #endif #include "nvim/buffer_defs.h" // buffer and windows -- cgit From ec1738a6ed08dd3a89fd07950fa2dcc55a72b705 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Wed, 21 Dec 2022 12:00:05 +0100 Subject: refactor: replace char_u with char 16 - remove STRNCMP (#21208) refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/vim.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 52af85ccc6..59b818fad7 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -201,7 +201,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) // NOLINT(runtime/printf) #define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n)) -#define STRNCMP(d, s, n) strncmp((char *)(d), (char *)(s), (size_t)(n)) #ifdef HAVE_STRCASECMP # define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s)) #else -- cgit From 5b89d480e30367259f82680945572b1406219da5 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 15 Dec 2022 21:23:28 +0100 Subject: vim-patch:9.0.1061: cannot display 'showcmd' somewhere else Problem: Cannot display 'showcmd' somewhere else. Solution: Add the 'showcmdloc' option. (Luuk van Baal, closes vim/vim#11684) https://github.com/vim/vim/commit/ba936f6f4e85cc1408bc3967f9fd7665d948909b Co-authored-by: Luuk van Baal --- src/nvim/vim.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index 59b818fad7..bfe75ef9f7 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -235,8 +235,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() // destination and mess up the screen. #define PERROR(msg) (void)semsg("%s: %s", (msg), strerror(errno)) -#define SHOWCMD_COLS 10 // columns needed by shown command - #include "nvim/path.h" // Enums need a typecast to be used as array index. -- cgit From e8ab2187166801cdbc87cea57fa0b3aba8e75064 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Mon, 2 Jan 2023 15:43:07 +0100 Subject: feat(message): avoid spam on failed os_msg also de-dupe the code --- src/nvim/vim.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index bfe75ef9f7..df24e423cf 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -245,12 +245,10 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() /// plus six following composing characters of three bytes each. #define MB_MAXBYTES 21 -// This has to go after the include of proto.h, as proto/gui.pro declares -// functions of these names. The declarations would break if the defines had -// been seen at that stage. But it must be before globals.h, where error_ga -// is declared. #ifndef MSWIN +/// Headless (no UI) error message handler. # define os_errmsg(str) fprintf(stderr, "%s", (str)) +/// Headless (no UI) message handler. # define os_msg(str) printf("%s", (str)) #endif -- cgit From 149209400383c673fdb4fdd1c9a7639139f17936 Mon Sep 17 00:00:00 2001 From: dundargoc <33953936+dundargoc@users.noreply.github.com> Date: Mon, 9 Jan 2023 14:13:06 +0100 Subject: refactor: replace char_u with char 17 - remove STRLCPY (#21235) refactor: replace char_u with char Work on https://github.com/neovim/neovim/issues/459 --- src/nvim/vim.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index df24e423cf..c395eb438c 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -200,7 +200,6 @@ enum { FOLD_TEXT_LEN = 51, }; //!< buffer size for get_foldtext() #endif #define STRCPY(d, s) strcpy((char *)(d), (char *)(s)) // NOLINT(runtime/printf) -#define STRLCPY(d, s, n) xstrlcpy((char *)(d), (char *)(s), (size_t)(n)) #ifdef HAVE_STRCASECMP # define STRICMP(d, s) strcasecmp((char *)(d), (char *)(s)) #else -- cgit From f2056e4045a667447392f5e17c27b0f72ec7b8e0 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 15 Jan 2023 06:20:01 +0800 Subject: vim-patch:8.2.4565: no command line completion for :breakadd and :breakdel Problem: No command line completion for :breakadd and :breakdel. Solution: Add completion for :breakadd and :breakdel. (Yegappan Lakshmanan, closes vim/vim#9950) https://github.com/vim/vim/commit/6e2e2cc95b913e33145047e0fade5193da6e4379 --- src/nvim/vim.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/nvim/vim.h') diff --git a/src/nvim/vim.h b/src/nvim/vim.h index c395eb438c..0ab9d96173 100644 --- a/src/nvim/vim.h +++ b/src/nvim/vim.h @@ -154,6 +154,7 @@ enum { EXPAND_MAPCLEAR, EXPAND_ARGLIST, EXPAND_DIFF_BUFFERS, + EXPAND_BREAKPOINT, EXPAND_CHECKHEALTH, EXPAND_LUA, }; -- cgit