aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/statusline_defs.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 22:39:54 +0000
commit21cb7d04c387e4198ca8098a884c78b56ffcf4c2 (patch)
tree84fe5690df1551f0bb2bdfe1a13aacd29ebc1de7 /src/nvim/statusline_defs.h
parentd9c904f85a23a496df4eb6be42aa43f007b22d50 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-colorcolchar.tar.gz
rneovim-colorcolchar.tar.bz2
rneovim-colorcolchar.zip
Merge remote-tracking branch 'upstream/master' into colorcolcharcolorcolchar
Diffstat (limited to 'src/nvim/statusline_defs.h')
-rw-r--r--src/nvim/statusline_defs.h59
1 files changed, 55 insertions, 4 deletions
diff --git a/src/nvim/statusline_defs.h b/src/nvim/statusline_defs.h
index eac9dfd690..c1a54f4f54 100644
--- a/src/nvim/statusline_defs.h
+++ b/src/nvim/statusline_defs.h
@@ -1,9 +1,12 @@
-#ifndef NVIM_STATUSLINE_DEFS_H
-#define NVIM_STATUSLINE_DEFS_H
+#pragma once
+#include <stdbool.h>
#include <stddef.h>
-#include "nvim/macros.h"
+#include "nvim/fold_defs.h"
+#include "nvim/macros_defs.h"
+#include "nvim/os/os_defs.h"
+#include "nvim/sign_defs.h"
/// Status line click definition
typedef struct {
@@ -23,4 +26,52 @@ typedef struct {
const char *start; ///< Location where region starts.
} StlClickRecord;
-#endif // NVIM_STATUSLINE_DEFS_H
+/// Used for highlighting in the status line.
+typedef struct stl_hlrec stl_hlrec_t;
+struct stl_hlrec {
+ char *start;
+ int userhl; // 0: no HL, 1-9: User HL, < 0 for syn ID
+};
+
+/// Used for building the status line.
+typedef struct stl_item stl_item_t;
+struct stl_item {
+ // Where the item starts in the status line output buffer
+ char *start;
+ // Function to run for ClickFunc items.
+ char *cmd;
+ // The minimum width of the item
+ int minwid;
+ // The maximum width of the item
+ int maxwid;
+ enum {
+ Normal,
+ Empty,
+ Group,
+ Separate,
+ Highlight,
+ TabPage,
+ ClickFunc,
+ Trunc,
+ } type;
+};
+
+/// Struct to hold info for 'statuscolumn'
+typedef struct statuscol statuscol_T;
+
+struct statuscol {
+ int width; ///< width of the status column
+ int cur_attr; ///< current attributes in text
+ int num_attr; ///< default highlight attr
+ int sign_cul_id; ///< cursorline sign highlight id
+ int truncate; ///< truncated width
+ bool draw; ///< whether to draw the statuscolumn
+ bool use_cul; ///< whether to use cursorline attrs
+ char text[MAXPATHL]; ///< text in status column
+ char *textp; ///< current position in text
+ char *text_end; ///< end of text (the NUL byte)
+ stl_hlrec_t *hlrec; ///< highlight groups
+ stl_hlrec_t *hlrecp; ///< current highlight group
+ foldinfo_T foldinfo; ///< fold information
+ SignTextAttrs *sattrs; ///< sign attributes
+};