From 4f8941c1a5f1ef6caa410feeb52e343db22763ce Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 10 Nov 2023 12:23:42 +0100 Subject: refactor: replace manual header guards with #pragma once It is less error-prone than manually defining header guards. Pretty much all compilers support it even if it's not part of the C standard. --- src/nvim/edit.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/nvim/edit.h') diff --git a/src/nvim/edit.h b/src/nvim/edit.h index 91c519f015..e64e45bec1 100644 --- a/src/nvim/edit.h +++ b/src/nvim/edit.h @@ -1,5 +1,4 @@ -#ifndef NVIM_EDIT_H -#define NVIM_EDIT_H +#pragma once #include "nvim/autocmd.h" #include "nvim/vim.h" @@ -29,4 +28,3 @@ #ifdef INCLUDE_GENERATED_DECLARATIONS # include "edit.h.generated.h" #endif -#endif // NVIM_EDIT_H -- cgit From 6343d414369de1f3b259e51438cd4f666d82d3d2 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 11:17:04 +0800 Subject: refactor: move autocmd types to autocmd_defs.h (#26239) --- src/nvim/edit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/edit.h') diff --git a/src/nvim/edit.h b/src/nvim/edit.h index e64e45bec1..c50b3bb0fb 100644 --- a/src/nvim/edit.h +++ b/src/nvim/edit.h @@ -1,6 +1,6 @@ #pragma once -#include "nvim/autocmd.h" +#include "nvim/autocmd_defs.h" #include "nvim/vim.h" // Values for in_cinkeys() -- cgit From 574d25642fc9ca65b396633aeab6e2d32778b642 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 27 Nov 2023 17:21:58 +0800 Subject: refactor: move Arena and ArenaMem to memory_defs.h (#26240) --- src/nvim/edit.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/edit.h') diff --git a/src/nvim/edit.h b/src/nvim/edit.h index c50b3bb0fb..33087f718f 100644 --- a/src/nvim/edit.h +++ b/src/nvim/edit.h @@ -1,7 +1,8 @@ #pragma once -#include "nvim/autocmd_defs.h" -#include "nvim/vim.h" +#include "nvim/autocmd_defs.h" // IWYU pragma: keep +#include "nvim/buffer_defs.h" // IWYU pragma: keep +#include "nvim/pos.h" // Values for in_cinkeys() #define KEY_OPEN_FORW 0x101 -- cgit From f4aedbae4cb1f206f5b7c6142697b71dd473059b Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 18:39:38 +0100 Subject: build(IWYU): fix includes for undo_defs.h --- src/nvim/edit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/edit.h') diff --git a/src/nvim/edit.h b/src/nvim/edit.h index 33087f718f..7cf4141045 100644 --- a/src/nvim/edit.h +++ b/src/nvim/edit.h @@ -2,7 +2,7 @@ #include "nvim/autocmd_defs.h" // IWYU pragma: keep #include "nvim/buffer_defs.h" // IWYU pragma: keep -#include "nvim/pos.h" +#include "nvim/pos_defs.h" // Values for in_cinkeys() #define KEY_OPEN_FORW 0x101 -- cgit From 718053b7a97c4e2fbaa6077d3c9f4dc7012c8aad Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 28 Nov 2023 07:47:36 +0800 Subject: refactor: fix runtime_defs.h (#26259) --- src/nvim/edit.h | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) (limited to 'src/nvim/edit.h') diff --git a/src/nvim/edit.h b/src/nvim/edit.h index 7cf4141045..434b653f7b 100644 --- a/src/nvim/edit.h +++ b/src/nvim/edit.h @@ -2,29 +2,37 @@ #include "nvim/autocmd_defs.h" // IWYU pragma: keep #include "nvim/buffer_defs.h" // IWYU pragma: keep -#include "nvim/pos_defs.h" +#include "nvim/pos_defs.h" // IWYU pragma: keep -// Values for in_cinkeys() -#define KEY_OPEN_FORW 0x101 -#define KEY_OPEN_BACK 0x102 -#define KEY_COMPLETE 0x103 // end of completion +/// Values for in_cinkeys() +enum { + KEY_OPEN_FORW = 0x101, + KEY_OPEN_BACK = 0x102, + KEY_COMPLETE = 0x103, ///< end of completion +}; -// Values for change_indent() -#define INDENT_SET 1 // set indent -#define INDENT_INC 2 // increase indent -#define INDENT_DEC 3 // decrease indent +/// Values for change_indent() +enum { + INDENT_SET = 1, ///< set indent + INDENT_INC = 2, ///< increase indent + INDENT_DEC = 3, ///< decrease indent +}; -// flags for beginline() -#define BL_WHITE 1 // cursor on first non-white in the line -#define BL_SOL 2 // use 'sol' option -#define BL_FIX 4 // don't leave cursor on a NUL +/// flags for beginline() +enum { + BL_WHITE = 1, ///< cursor on first non-white in the line + BL_SOL = 2, ///< use 'sol' option + BL_FIX = 4, ///< don't leave cursor on a NUL +}; -// flags for insertchar() -#define INSCHAR_FORMAT 1 // force formatting -#define INSCHAR_DO_COM 2 // format comments -#define INSCHAR_CTRLV 4 // char typed just after CTRL-V -#define INSCHAR_NO_FEX 8 // don't use 'formatexpr' -#define INSCHAR_COM_LIST 16 // format comments with list/2nd line indent +/// flags for insertchar() +enum { + INSCHAR_FORMAT = 1, ///< force formatting + INSCHAR_DO_COM = 2, ///< format comments + INSCHAR_CTRLV = 4, ///< char typed just after CTRL-V + INSCHAR_NO_FEX = 8, ///< don't use 'formatexpr' + INSCHAR_COM_LIST = 16, ///< format comments with list/2nd line indent +}; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "edit.h.generated.h" -- cgit