aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2024-12-10 14:03:44 +0100
committerbfredl <bjorn.linse@gmail.com>2024-12-16 12:46:59 +0100
commit2d6f57b2891247f9ca0f6fb75c4b93fb2c714dc4 (patch)
treed7bb06b9366e0640d4299a3c7adce644f8e4086e /src/nvim/buffer_defs.h
parent9c6a3703bb15d56fecdd962512f69f0ccf6d398c (diff)
downloadrneovim-2d6f57b2891247f9ca0f6fb75c4b93fb2c714dc4.tar.gz
rneovim-2d6f57b2891247f9ca0f6fb75c4b93fb2c714dc4.tar.bz2
rneovim-2d6f57b2891247f9ca0f6fb75c4b93fb2c714dc4.zip
refactor(wininfo): change wininfo from a linked list to an array
"wininfo" is going to be my next victim. The main problem with wininfo is that it is "all or nothing", i e either all state about a buffer in a window is considered valid or none of it is. This needs to be fixed to address some long running grievances. For now this is just a warmup: refactor it from a linked list to a vector.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index bb6eef3c29..3fe44beab9 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -70,7 +70,7 @@ typedef struct {
// Mask to check for flags that prevent normal writing
#define BF_WRITE_MASK (BF_NOTEDITED + BF_NEW + BF_READERR)
-typedef struct wininfo_S wininfo_T;
+typedef struct wininfo_S WinInfo;
typedef struct frame_S frame_T;
typedef uint64_t disptick_T; // display tick type
@@ -85,7 +85,7 @@ typedef struct {
// Structure that contains all options that are local to a window.
// Used twice in a window: for the current buffer and for all buffers.
-// Also used in wininfo_T.
+// Also used in WinInfo.
typedef struct {
int wo_arab;
#define w_p_arab w_onebuf_opt.wo_arab // 'arabic'
@@ -219,8 +219,6 @@ typedef struct {
// The window-info is kept in a list at b_wininfo. It is kept in
// most-recently-used order.
struct wininfo_S {
- wininfo_T *wi_next; // next entry or NULL for last entry
- wininfo_T *wi_prev; // previous entry or NULL for first entry
win_T *wi_win; // pointer to window that did set wi_mark
fmark_T wi_mark; // last cursor mark in the file
bool wi_optset; // true when wi_opt has useful values
@@ -411,7 +409,7 @@ struct file_buffer {
// change
linenr_T b_mod_xlines; // number of extra buffer lines inserted;
// negative when lines were deleted
- wininfo_T *b_wininfo; // list of last used info for each window
+ kvec_t(WinInfo *) b_wininfo; // list of last used info for each window
disptick_T b_mod_tick_syn; // last display tick syntax was updated
disptick_T b_mod_tick_decor; // last display tick decoration providers
// where invoked