From 95dbf1af73a6f73f08f988adb6d6436d680f53c4 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 30 Nov 2023 18:41:52 +0800 Subject: refactor: move extern variables out of _defs.h files (#26320) --- src/nvim/buffer_defs.h | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index e59539f900..8928eea028 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -357,8 +357,6 @@ typedef struct { #define BUF_UPDATE_CALLBACKS_INIT { LUA_NOREF, LUA_NOREF, LUA_NOREF, \ LUA_NOREF, LUA_NOREF, false, false } -EXTERN int curbuf_splice_pending INIT( = 0); - #define BUF_HAS_QF_ENTRY 1 #define BUF_HAS_LL_ENTRY 2 @@ -904,12 +902,7 @@ enum { kFloatAnchorSouth = 2, }; -// NW -> 0 -// NE -> kFloatAnchorEast -// SW -> kFloatAnchorSouth -// SE -> kFloatAnchorSouth | kFloatAnchorEast -EXTERN const char *const float_anchor_str[] INIT( = { "NW", "NE", "SW", "SE" }); - +/// Keep in sync with float_relative_str in winfloat.h typedef enum { kFloatRelativeEditor = 0, kFloatRelativeWindow = 1, @@ -917,9 +910,6 @@ typedef enum { kFloatRelativeMouse = 3, } FloatRelative; -EXTERN const char *const float_relative_str[] INIT( = { "editor", "win", - "cursor", "mouse" }); - typedef enum { kWinStyleUnused = 0, kWinStyleMinimal, /// Minimal UI: no number column, eob markers, etc -- cgit From 76a30f2bd0f4e5abe906eabcdce092931d712be3 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 1 Dec 2023 16:37:09 +0800 Subject: refactor: move float_relative_str[] to nvim_win_get_config() (#26344) It's only used in one place, as it's usually conveyed as non-string. --- src/nvim/buffer_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 8928eea028..b26d42385b 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -902,7 +902,7 @@ enum { kFloatAnchorSouth = 2, }; -/// Keep in sync with float_relative_str in winfloat.h +/// Keep in sync with float_relative_str[] in nvim_win_get_config() typedef enum { kFloatRelativeEditor = 0, kFloatRelativeWindow = 1, -- cgit From 14572727261278e5bf68080c9369a8507f3d564f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 5 Dec 2023 20:05:12 +0800 Subject: refactor(IWYU): move marktree types to marktree_defs.h (#26402) --- src/nvim/buffer_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index b26d42385b..7402e66403 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -26,7 +26,7 @@ typedef struct { #include "nvim/map_defs.h" #include "nvim/mapping_defs.h" #include "nvim/mark_defs.h" -#include "nvim/marktree.h" +#include "nvim/marktree_defs.h" #include "nvim/option_vars.h" #include "nvim/pos_defs.h" #include "nvim/statusline_defs.h" -- cgit From 4a34da82c18e6da1e46d6bf3d21082a6b6c8b947 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Wed, 6 Dec 2023 13:34:19 +0100 Subject: perf(column): keep track of number of lines that hold up the 'signcolumn' Problem: The entire marktree needs to be traversed each time a sign is removed from the sentinel line. Solution: Remove sentinel line and instead keep track of the number of lines that hold up the 'signcolumn' in "max_count". Adjust this number for added/removed signs, and set it to 0 when the maximum number of signs on a line changes. Only when "max_count" is decremented to 0 due to sign removal do we need to check the entire buffer. Also replace "invalid_top" and "invalid_bot" with a map of invalid ranges, further reducing the number of lines to be checked. Also improve tree traversal when counting the number of signs. Instead of looping over the to be checked range and counting the overlap for each row, keep track of the overlap in an array and add this to the count. --- src/nvim/buffer_defs.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 7402e66403..beb3ec95b8 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -703,11 +703,10 @@ struct file_buffer { // may use a different synblock_T. struct { - int size; // last calculated number of sign columns - int max; // maximum value size is valid for. - linenr_T sentinel; // a line number which is holding up the signcolumn - linenr_T invalid_top; // first invalid line number that needs to be checked - linenr_T invalid_bot; // last invalid line number that needs to be checked + int max; // maximum number of signs on a single line + int max_count; // number of lines with max number of signs + bool resized; // whether max changed at start of redraw + Map(int, SignRange) invalid[1]; // map of invalid ranges to be checked } b_signcols; Terminal *terminal; // Terminal instance associated with the buffer -- cgit From e38027ef69f75653ee953b16ebf4a8652a3fb748 Mon Sep 17 00:00:00 2001 From: mathew Date: Tue, 15 Aug 2023 18:47:14 +0800 Subject: feat(ui): completeopt support popup like vim --- src/nvim/buffer_defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index beb3ec95b8..dc93243fad 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -1286,7 +1286,8 @@ struct window_S { ScreenGrid w_grid; // the grid specific to the window ScreenGrid w_grid_alloc; // the grid specific to the window bool w_pos_changed; // true if window position changed - bool w_floating; ///< whether the window is floating + bool w_floating; ///< whether the window is floating + bool w_float_is_info; // the floating window is info float FloatConfig w_float_config; // w_fraction is the fractional row of the cursor within the window, from -- cgit From 0c120307ca1ab613e63865c634d7e10ad67fb0ba Mon Sep 17 00:00:00 2001 From: dundargoc Date: Wed, 20 Dec 2023 14:32:22 +0100 Subject: refactor: eliminate cyclic includes --- src/nvim/buffer_defs.h | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index dc93243fad..49d2126801 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -4,16 +4,6 @@ #include #include -typedef struct file_buffer buf_T; - -/// Reference to a buffer that stores the value of buf_free_count. -/// bufref_valid() only needs to check "buf" when the count differs. -typedef struct { - buf_T *br_buf; - int br_fnum; - int br_buf_free_count; -} bufref_T; - #include "klib/kvec.h" #include "nvim/api/private/defs.h" #include "nvim/arglist_defs.h" @@ -27,11 +17,24 @@ typedef struct { #include "nvim/mapping_defs.h" #include "nvim/mark_defs.h" #include "nvim/marktree_defs.h" +#include "nvim/memline_defs.h" #include "nvim/option_vars.h" +#include "nvim/os/fs_defs.h" #include "nvim/pos_defs.h" +#include "nvim/regexp_defs.h" +#include "nvim/sign_defs.h" #include "nvim/statusline_defs.h" +#include "nvim/terminal.h" #include "nvim/undo_defs.h" +/// Reference to a buffer that stores the value of buf_free_count. +/// bufref_valid() only needs to check "buf" when the count differs. +typedef struct { + buf_T *br_buf; + int br_fnum; + int br_buf_free_count; +} bufref_T; + #define GETFILE_SUCCESS(x) ((x) <= 0) #define MODIFIABLE(buf) (buf->b_p_ma) @@ -80,18 +83,10 @@ typedef struct { // Mask to check for flags that prevent normal writing #define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR) -typedef struct window_S win_T; typedef struct wininfo_S wininfo_T; typedef struct frame_S frame_T; typedef uint64_t disptick_T; // display tick type -#include "nvim/memline_defs.h" -#include "nvim/os/fs_defs.h" -#include "nvim/regexp_defs.h" -#include "nvim/sign_defs.h" -#include "nvim/syntax_defs.h" -#include "nvim/terminal.h" - // The taggy struct is used to store the information about a :tag command. typedef struct taggy { char *tagname; // tag name -- cgit From 8533adb4844b771b84dac2141fa2fa60e0487b47 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 21 Dec 2023 16:50:05 +0800 Subject: refactor(IWYU): move decor provider types to decoration_defs.h (#26692) --- src/nvim/buffer_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 49d2126801..3a6b5e2c6b 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -24,7 +24,7 @@ #include "nvim/regexp_defs.h" #include "nvim/sign_defs.h" #include "nvim/statusline_defs.h" -#include "nvim/terminal.h" +#include "nvim/types_defs.h" #include "nvim/undo_defs.h" /// Reference to a buffer that stores the value of buf_free_count. -- cgit From 089b934352437ab310a6dd3b138c7ed9445a3d7b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 22 Dec 2023 12:24:23 +0800 Subject: refactor(options): generate BV_ and WV_ constants (#26705) --- src/nvim/buffer_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 3a6b5e2c6b..ca6e874c1f 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -18,7 +18,7 @@ #include "nvim/mark_defs.h" #include "nvim/marktree_defs.h" #include "nvim/memline_defs.h" -#include "nvim/option_vars.h" +#include "nvim/option_defs.h" #include "nvim/os/fs_defs.h" #include "nvim/pos_defs.h" #include "nvim/regexp_defs.h" -- cgit From ab2aad509d6e4fc57a6afe056275405ec6451671 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Wed, 20 Dec 2023 17:22:19 +0100 Subject: refactor: follow style guide --- src/nvim/buffer_defs.h | 6 ------ 1 file changed, 6 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index ca6e874c1f..afe77b84f5 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -1316,9 +1316,3 @@ struct window_S { // Size of the w_statuscol_click_defs array size_t w_statuscol_click_defs_size; }; - -/// Macros defined in Vim, but not in Neovim -// uncrustify:off -#define CHANGEDTICK(buf) \ - (=== Include buffer.h & use buf_(get|set|inc) _changedtick ===) -// uncrustify:on -- cgit From 735aa4c4c89943b26f1d6ba0d3e076002490c09d Mon Sep 17 00:00:00 2001 From: dundargoc Date: Sun, 31 Dec 2023 01:54:34 +0100 Subject: refactor: remove redundant struct names A struct can be anonymous if only its typedef is used. --- src/nvim/buffer_defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index afe77b84f5..c6bd5691b1 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -88,7 +88,7 @@ typedef struct frame_S frame_T; typedef uint64_t disptick_T; // display tick type // The taggy struct is used to store the information about a :tag command. -typedef struct taggy { +typedef struct { char *tagname; // tag name fmark_T fmark; // cursor position BEFORE ":tag" int cur_match; // match number @@ -808,7 +808,7 @@ struct tabpage_S { // may not reflect what is actually in the buffer. When wl_valid is false, // the entries can only be used to count the number of displayed lines used. // wl_lnum and wl_lastlnum are invalid too. -typedef struct w_line { +typedef struct { linenr_T wl_lnum; // buffer line number for logical line uint16_t wl_size; // height in screen lines char wl_valid; // true values are valid for text in buffer -- cgit From aeb053907d2f27713764e345b00a6618e23220d8 Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 3 Jan 2024 13:31:39 +0100 Subject: refactor(options): use schar_T representation for fillchars and listchars A bit big, but practically it was a lot simpler to change over all fillchars and all listchars at once, to not need to maintain two parallel implementations. This is mostly an internal refactor, but it also removes an arbitrary limitation: that 'fillchars' and 'listchars' values can only be single-codepoint characters. Now any character which fits into a single screen cell can be used. --- src/nvim/buffer_defs.h | 62 +++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index c6bd5691b1..085070fc4a 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -971,41 +971,41 @@ typedef struct { /// Characters from the 'listchars' option. typedef struct { - int eol; - int ext; - int prec; - int nbsp; - int space; - int tab1; ///< first tab character - int tab2; ///< second tab character - int tab3; ///< third tab character - int lead; - int trail; - int *multispace; - int *leadmultispace; - int conceal; + schar_T eol; + schar_T ext; + schar_T prec; + schar_T nbsp; + schar_T space; + schar_T tab1; ///< first tab character + schar_T tab2; ///< second tab character + schar_T tab3; ///< third tab character + schar_T lead; + schar_T trail; + schar_T *multispace; + schar_T *leadmultispace; + schar_T conceal; } lcs_chars_T; /// Characters from the 'fillchars' option. typedef struct { - int stl; - int stlnc; - int wbr; - int horiz; - int horizup; - int horizdown; - int vert; - int vertleft; - int vertright; - int verthoriz; - int fold; - int foldopen; ///< when fold is open - int foldclosed; ///< when fold is closed - int foldsep; ///< continuous fold marker - int diff; - int msgsep; - int eob; - int lastline; + schar_T stl; + schar_T stlnc; + schar_T wbr; + schar_T horiz; + schar_T horizup; + schar_T horizdown; + schar_T vert; + schar_T vertleft; + schar_T vertright; + schar_T verthoriz; + schar_T fold; + schar_T foldopen; ///< when fold is open + schar_T foldclosed; ///< when fold is closed + schar_T foldsep; ///< continuous fold marker + schar_T diff; + schar_T msgsep; + schar_T eob; + schar_T lastline; } fcs_chars_T; /// Structure which contains all information that belongs to a window. -- cgit From 1813661a6197c76ea6621284570aca1d56597099 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Thu, 4 Jan 2024 15:38:16 +0100 Subject: refactor(IWYU): fix headers Remove `export` pramgas from defs headers as it causes IWYU to believe that the definitions from the defs headers comes from main header, which is not what we really want. --- src/nvim/buffer_defs.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 085070fc4a..f09aa70ef4 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -4,27 +4,14 @@ #include #include -#include "klib/kvec.h" -#include "nvim/api/private/defs.h" #include "nvim/arglist_defs.h" -#include "nvim/eval/typval_defs.h" -#include "nvim/extmark_defs.h" -#include "nvim/garray_defs.h" #include "nvim/grid_defs.h" -#include "nvim/hashtab_defs.h" -#include "nvim/highlight_defs.h" -#include "nvim/map_defs.h" #include "nvim/mapping_defs.h" -#include "nvim/mark_defs.h" #include "nvim/marktree_defs.h" #include "nvim/memline_defs.h" #include "nvim/option_defs.h" #include "nvim/os/fs_defs.h" -#include "nvim/pos_defs.h" -#include "nvim/regexp_defs.h" -#include "nvim/sign_defs.h" #include "nvim/statusline_defs.h" -#include "nvim/types_defs.h" #include "nvim/undo_defs.h" /// Reference to a buffer that stores the value of buf_free_count. -- cgit From 967c7abde3c6fa3210a4920a5848a54dc913d851 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Thu, 11 Jan 2024 14:30:12 +0100 Subject: fix(column): keep track of number of lines with number of signs Problem: Some edge cases to the old (pre-#26406) and current "b_signcols" structure result in an incorrectly sized "auto" 'signcolumn'. Solution: * Implement a simpler 'signcolumn' validation strategy by immediately counting the number of signs in a range upon sign insertion and deletion. Decrease in performance here but there is a clear path forward to decreasing this performance hit by moving signs to a dedicated marktree, or by adding meta-data to the existing marktree which may be queried more efficiently? * Also replace "max_count" and keep track of the number of lines with a certain number of signs. This makes it so that it is no longer necessary to scan the entire buffer when the maximum number of signs decreases. This likely makes the commit a net increase in performance. * To ensure correctness we also have re-initialize the count for an edited region that spans multiple lines. Such an edit may move the signs within it. Thus we count and decrement before splicing the marktree and count and increment after. --- src/nvim/buffer_defs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index f09aa70ef4..145a8435aa 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -685,10 +685,12 @@ struct file_buffer { // may use a different synblock_T. struct { - int max; // maximum number of signs on a single line - int max_count; // number of lines with max number of signs - bool resized; // whether max changed at start of redraw - Map(int, SignRange) invalid[1]; // map of invalid ranges to be checked + int max; // maximum number of signs on a single line + int count[SIGN_SHOW_MAX]; // number of lines with number of signs + bool resized; // whether max changed at start of redraw + bool autom; // whether 'signcolumn' is displayed in "auto:n>1" + // configured window. "b_signcols" calculation + // is skipped if false. } b_signcols; Terminal *terminal; // Terminal instance associated with the buffer -- cgit From 9af2be292db3db7b28a6210263f719a6bbc4059f Mon Sep 17 00:00:00 2001 From: bfredl Date: Fri, 12 Jan 2024 14:38:18 +0100 Subject: perf(extmarks): add metadata for efficient filtering of special decorations This expands on the global "don't pay for what you don't use" rules for these special extmark decorations: - inline virtual text, which needs to be processed in plines.c when we calculate the size of text on screen - virtual lines, which are needed when calculating "filler" lines - signs, with text and/or highlights, both of which needs to be processed for the entire line already at the beginning of a line. This adds a count to each node of the marktree, for how many special marks of each kind can be found in the subtree for this node. This makes it possible to quickly skip over these extra checks, when working in regions of the buffer not containing these kind of marks, instead of before where this could just be skipped if the entire _buffer_ didn't contain such marks. --- src/nvim/buffer_defs.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 145a8435aa..79527176ab 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -701,10 +701,6 @@ struct file_buffer { MarkTree b_marktree[1]; Map(uint32_t, uint32_t) b_extmark_ns[1]; // extmark namespaces - size_t b_virt_text_inline; // number of inline virtual texts - size_t b_virt_line_blocks; // number of virt_line blocks - size_t b_signs; // number of sign extmarks - size_t b_signs_with_text; // number of sign extmarks with text // array of channel_id:s which have asked to receive updates for this // buffer. -- cgit From 5b1b765610ae12ebd6400aafd068903569ee441a Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Sun, 28 Jan 2024 20:53:14 -0500 Subject: docs: enforce "treesitter" spelling #27110 It's the "tree-sitter" project, but "treesitter" in our code and docs. --- src/nvim/buffer_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 79527176ab..24f97dd92c 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -713,7 +713,7 @@ struct file_buffer { // Measurements of the deleted or replaced region since the last update // event. Some consumers of buffer changes need to know the byte size (like - // tree-sitter) or the corresponding UTF-32/UTF-16 size (like LSP) of the + // treesitter) or the corresponding UTF-32/UTF-16 size (like LSP) of the // deleted text. size_t deleted_bytes; size_t deleted_bytes2; -- cgit From 6bba4becedaea5a330c0c9d9427fb495e8092dac Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Wed, 31 Jan 2024 19:43:35 -0800 Subject: feat(api): make nvim_open_win support non-floating windows (#25550) Adds support to `nvim_open_win` and `nvim_win_set_config` for creating and manipulating split (non-floating) windows. --- src/nvim/buffer_defs.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 24f97dd92c..ea014c3918 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -889,6 +889,14 @@ typedef enum { kFloatRelativeMouse = 3, } FloatRelative; +/// Keep in sync with win_split_str[] in nvim_win_get_config() (api/win_config.c) +typedef enum { + kWinSplitLeft = 0, + kWinSplitRight = 1, + kWinSplitAbove = 2, + kWinSplitBelow = 3, +} WinSplit; + typedef enum { kWinStyleUnused = 0, kWinStyleMinimal, /// Minimal UI: no number column, eob markers, etc @@ -914,6 +922,7 @@ typedef struct { FloatRelative relative; bool external; bool focusable; + WinSplit split; int zindex; WinStyle style; bool border; @@ -939,6 +948,7 @@ typedef struct { .row = 0, .col = 0, .anchor = 0, \ .relative = 0, .external = false, \ .focusable = true, \ + .split = 0, \ .zindex = kZIndexFloatDefault, \ .style = kWinStyleUnused, \ .noautocmd = false, \ -- cgit From 44ec4b5b18d1ba856dc3305d8dfb0e8d9507dd50 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Fri, 9 Feb 2024 08:17:10 -0800 Subject: refactor: rename FloatConfig to WinConfig #27397 `FloatConfig` is no longer used only for floats, so the name is counterintuitive. Followup to #25550 --- src/nvim/buffer_defs.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index ea014c3918..adbece20f2 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -941,19 +941,19 @@ typedef struct { bool noautocmd; bool fixed; bool hide; -} FloatConfig; - -#define FLOAT_CONFIG_INIT ((FloatConfig){ .height = 0, .width = 0, \ - .bufpos = { -1, 0 }, \ - .row = 0, .col = 0, .anchor = 0, \ - .relative = 0, .external = false, \ - .focusable = true, \ - .split = 0, \ - .zindex = kZIndexFloatDefault, \ - .style = kWinStyleUnused, \ - .noautocmd = false, \ - .hide = false, \ - .fixed = false }) +} WinConfig; + +#define WIN_CONFIG_INIT ((WinConfig){ .height = 0, .width = 0, \ + .bufpos = { -1, 0 }, \ + .row = 0, .col = 0, .anchor = 0, \ + .relative = 0, .external = false, \ + .focusable = true, \ + .split = 0, \ + .zindex = kZIndexFloatDefault, \ + .style = kWinStyleUnused, \ + .noautocmd = false, \ + .hide = false, \ + .fixed = false }) // Structure to store last cursor position and topline. Used by check_lnums() // and reset_lnums(). @@ -1278,7 +1278,7 @@ struct window_S { bool w_pos_changed; // true if window position changed bool w_floating; ///< whether the window is floating bool w_float_is_info; // the floating window is info float - FloatConfig w_float_config; + WinConfig w_float_config; // w_fraction is the fractional row of the cursor within the window, from // 0 at the top row to FRACTION_MULT at the last row. -- cgit From f1f8fa850f741b7c35b8ff9c02ac2810a75e25b1 Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Sat, 10 Feb 2024 13:06:01 -0800 Subject: refactor: rename w_float_config to w_config #27419 Follows up on rename of `FloatConfig` to `WinConfig` in #27397. --- src/nvim/buffer_defs.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index adbece20f2..80e8b88182 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -913,6 +913,7 @@ typedef enum { kBorderTextFooter = 1, } BorderTextType; +/// See ":help nvim_open_win()" for documentation. typedef struct { Window window; lpos_T bufpos; @@ -1278,7 +1279,7 @@ struct window_S { bool w_pos_changed; // true if window position changed bool w_floating; ///< whether the window is floating bool w_float_is_info; // the floating window is info float - WinConfig w_float_config; + WinConfig w_config; // w_fraction is the fractional row of the cursor within the window, from // 0 at the top row to FRACTION_MULT at the last row. -- cgit From 1c032ad703a19cd5c8498ee95f9352df87a91139 Mon Sep 17 00:00:00 2001 From: altermo <107814000+altermo@users.noreply.github.com> Date: Tue, 6 Feb 2024 11:52:42 +0100 Subject: feat(extmark): window scoped extmark Co-authored-by: zeertzjq --- src/nvim/buffer_defs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/buffer_defs.h') diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 80e8b88182..1e5086309c 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -1020,6 +1020,8 @@ struct window_S { int w_ns_hl_active; int *w_ns_hl_attr; + Set(uint32_t) w_ns_set; + int w_hl_id_normal; ///< 'winhighlight' normal id int w_hl_attr_normal; ///< 'winhighlight' normal final attrs int w_hl_attr_normalnc; ///< 'winhighlight' NormalNC final attrs -- cgit