aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/buffer_defs.h
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2021-11-21 22:14:03 -0700
committerJosh Rahm <rahm@google.com>2022-01-11 14:12:29 -0700
commit13c2be90350e0cab0cdc92c0614f42b93220be85 (patch)
tree651687cb66d35efecc458f0af344f72a3379f2de /src/nvim/buffer_defs.h
parent70fe3ce004f1c17328257349da5528757fdcd354 (diff)
downloadrneovim-13c2be90350e0cab0cdc92c0614f42b93220be85.tar.gz
rneovim-13c2be90350e0cab0cdc92c0614f42b93220be85.tar.bz2
rneovim-13c2be90350e0cab0cdc92c0614f42b93220be85.zip
Add the ability to title floating windows.
The window title is set using the {title} key on the FloatConfig. The window title allows for 3 different positions as defined by the {title_position} key in the FloatConfig: - left - center - right The title also supports StatusLine-style highlighting using the %#<HL># keys.
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r--src/nvim/buffer_defs.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h
index 63a550c017..d4b526dd1a 100644
--- a/src/nvim/buffer_defs.h
+++ b/src/nvim/buffer_defs.h
@@ -1081,6 +1081,12 @@ typedef enum {
kWinStyleMinimal, /// Minimal UI: no number column, eob markers, etc
} WinStyle;
+typedef enum {
+ kTitleLeft = 0,
+ kTitleCenter,
+ kTitleRight
+} TitlePosition;
+
typedef struct {
Window window;
lpos_T bufpos;
@@ -1098,6 +1104,11 @@ typedef struct {
int border_hl_ids[8];
int border_attr[8];
bool noautocmd;
+
+ stl_hlrec_t* title_hl;
+ char_u* title;
+ size_t n_title;
+ TitlePosition title_pos;
} FloatConfig;
#define FLOAT_CONFIG_INIT ((FloatConfig){ .height = 0, .width = 0, \
@@ -1107,7 +1118,11 @@ typedef struct {
.focusable = true, \
.zindex = kZIndexFloatDefault, \
.style = kWinStyleUnused, \
- .noautocmd = false })
+ .noautocmd = false, \
+ .title_hl = NULL, \
+ .title = NULL, \
+ .n_title = 0, \
+ .title_pos = kTitleLeft})
// Structure to store last cursor position and topline. Used by check_lnums()
// and reset_lnums().