From 6a273af10517d1f7e4ea85635f1d25a9158adeb5 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 13 May 2023 10:40:53 +0800 Subject: refactor: remove typval.h from most header files (#23601) Because typval_defs.h is enough for most of them. --- src/nvim/window.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index 4ab2bea60a..9201800d53 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -4,13 +4,9 @@ #include #include -#include "nvim/buffer.h" #include "nvim/buffer_defs.h" #include "nvim/macros.h" -#include "nvim/mark.h" -#include "nvim/os/os.h" -#include "nvim/os/os_defs.h" -#include "nvim/vim.h" +#include "nvim/option_defs.h" // Values for file_name_in_line() #define FNAME_MESS 1 // give error message -- cgit From 5f03a1eaabfc8de2b3a9c666fcd604763f41e152 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 20 Oct 2023 15:10:33 +0200 Subject: build(lint): remove unnecessary clint.py rules Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. --- src/nvim/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index 9201800d53..3abfb4d379 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -33,7 +33,7 @@ #define MIN_LINES 2 // minimal lines for screen // Set to true if 'cmdheight' was explicitly set to 0. -EXTERN bool p_ch_was_zero INIT(= false); +EXTERN bool p_ch_was_zero INIT( = false); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "window.h.generated.h" #endif -- cgit 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/window.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index 3abfb4d379..734fa71d72 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -1,5 +1,4 @@ -#ifndef NVIM_WINDOW_H -#define NVIM_WINDOW_H +#pragma once #include #include @@ -37,4 +36,3 @@ EXTERN bool p_ch_was_zero INIT( = false); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "window.h.generated.h" #endif -#endif // NVIM_WINDOW_H -- 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/window.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index 734fa71d72..e38fb953ab 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -1,11 +1,12 @@ #pragma once #include -#include -#include "nvim/buffer_defs.h" +#include "nvim/buffer_defs.h" // IWYU pragma: keep +#include "nvim/garray_defs.h" // IWYU pragma: keep #include "nvim/macros.h" -#include "nvim/option_defs.h" +#include "nvim/option_defs.h" // IWYU pragma: keep +#include "nvim/types.h" // Values for file_name_in_line() #define FNAME_MESS 1 // give error message -- cgit From 6c14ae6bfaf51415b555e9a6b85d1d280976358d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Mon, 27 Nov 2023 20:27:32 +0100 Subject: refactor: rename types.h to types_defs.h --- src/nvim/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index e38fb953ab..bc3ec6adb9 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -6,7 +6,7 @@ #include "nvim/garray_defs.h" // IWYU pragma: keep #include "nvim/macros.h" #include "nvim/option_defs.h" // IWYU pragma: keep -#include "nvim/types.h" +#include "nvim/types_defs.h" // Values for file_name_in_line() #define FNAME_MESS 1 // give error message -- 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/window.h | 53 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 23 deletions(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index bc3ec6adb9..9f82f3c4a8 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -6,34 +6,41 @@ #include "nvim/garray_defs.h" // IWYU pragma: keep #include "nvim/macros.h" #include "nvim/option_defs.h" // IWYU pragma: keep -#include "nvim/types_defs.h" +#include "nvim/types_defs.h" // IWYU pragma: keep -// Values for file_name_in_line() -#define FNAME_MESS 1 // give error message -#define FNAME_EXP 2 // expand to path -#define FNAME_HYP 4 // check for hypertext link -#define FNAME_INCL 8 // apply 'includeexpr' -#define FNAME_REL 16 // ".." and "./" are relative to the (current) - // file instead of the current directory -#define FNAME_UNESC 32 // remove backslashes used for escaping +/// Values for file_name_in_line() +enum { + FNAME_MESS = 1, ///< give error message + FNAME_EXP = 2, ///< expand to path + FNAME_HYP = 4, ///< check for hypertext link + FNAME_INCL = 8, ///< apply 'includeexpr' + FNAME_REL = 16, ///< ".." and "./" are relative to the (current) + ///< file instead of the current directory + FNAME_UNESC = 32, ///< remove backslashes used for escaping +}; -// arguments for win_split() -#define WSP_ROOM 0x01 // require enough room -#define WSP_VERT 0x02 // split/equalize vertically -#define WSP_HOR 0x04 // equalize horizontally -#define WSP_TOP 0x08 // window at top-left of shell -#define WSP_BOT 0x10 // window at bottom-right of shell -#define WSP_HELP 0x20 // creating the help window -#define WSP_BELOW 0x40 // put new window below/right -#define WSP_ABOVE 0x80 // put new window above/left -#define WSP_NEWLOC 0x100 // don't copy location list +/// arguments for win_split() +enum { + WSP_ROOM = 0x01, ///< require enough room + WSP_VERT = 0x02, ///< split/equalize vertically + WSP_HOR = 0x04, ///< equalize horizontally + WSP_TOP = 0x08, ///< window at top-left of shell + WSP_BOT = 0x10, ///< window at bottom-right of shell + WSP_HELP = 0x20, ///< creating the help window + WSP_BELOW = 0x40, ///< put new window below/right + WSP_ABOVE = 0x80, ///< put new window above/left + WSP_NEWLOC = 0x100, ///< don't copy location list +}; -// Minimum screen size -#define MIN_COLUMNS 12 // minimal columns for screen -#define MIN_LINES 2 // minimal lines for screen +/// Minimum screen size +enum { + MIN_COLUMNS = 12, ///< minimal columns for screen + MIN_LINES = 2, ///< minimal lines for screen +}; -// Set to true if 'cmdheight' was explicitly set to 0. +/// Set to true if 'cmdheight' was explicitly set to 0. EXTERN bool p_ch_was_zero INIT( = false); + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "window.h.generated.h" #endif -- cgit From 79b6ff28ad1204fbb4199b9092f5c578d88cb28e Mon Sep 17 00:00:00 2001 From: dundargoc Date: Tue, 28 Nov 2023 20:31:00 +0100 Subject: refactor: fix headers with IWYU --- src/nvim/window.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index 9f82f3c4a8..39dd7f8766 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -4,7 +4,7 @@ #include "nvim/buffer_defs.h" // IWYU pragma: keep #include "nvim/garray_defs.h" // IWYU pragma: keep -#include "nvim/macros.h" +#include "nvim/macros_defs.h" #include "nvim/option_defs.h" // IWYU pragma: keep #include "nvim/types_defs.h" // IWYU pragma: keep -- cgit From a6cba103cebce535279db197f9efeb34e9d1171f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 29 Nov 2023 20:32:40 +0800 Subject: refactor: move some constants out of vim_defs.h (#26298) --- src/nvim/window.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/nvim/window.h') diff --git a/src/nvim/window.h b/src/nvim/window.h index 39dd7f8766..3650fef46e 100644 --- a/src/nvim/window.h +++ b/src/nvim/window.h @@ -32,12 +32,15 @@ enum { WSP_NEWLOC = 0x100, ///< don't copy location list }; -/// Minimum screen size enum { - MIN_COLUMNS = 12, ///< minimal columns for screen - MIN_LINES = 2, ///< minimal lines for screen + MIN_COLUMNS = 12, ///< minimal columns for screen + MIN_LINES = 2, ///< minimal lines for screen + STATUS_HEIGHT = 1, ///< height of a status line under a window }; +/// Lowest number used for window ID. Cannot have this many windows per tab. +enum { LOWEST_WIN_ID = 1000, }; + /// Set to true if 'cmdheight' was explicitly set to 0. EXTERN bool p_ch_was_zero INIT( = false); -- cgit