feat(ui): add support to display a title in the border of a float (#20184)

add "title" and "title_pos" keys to win config dict.
This commit is contained in:
Raphael
2022-11-06 18:59:43 +08:00
committed by GitHub
parent a79d28e4d7
commit 1af4bd04f9
12 changed files with 371 additions and 3 deletions

View File

@@ -44,6 +44,8 @@ typedef struct {
#include "klib/kvec.h"
// for marktree
#include "nvim/marktree.h"
// for float window title
#include "nvim/extmark_defs.h"
#define GETFILE_SUCCESS(x) ((x) <= 0)
#define MODIFIABLE(buf) (buf->b_p_ma)
@@ -1048,6 +1050,12 @@ typedef enum {
kWinStyleMinimal, /// Minimal UI: no number column, eob markers, etc
} WinStyle;
typedef enum {
kAlignLeft = 0,
kAlignCenter = 1,
kAlignRight = 2,
} AlignTextPos;
typedef struct {
Window window;
lpos_T bufpos;
@@ -1060,10 +1068,14 @@ typedef struct {
int zindex;
WinStyle style;
bool border;
bool title;
bool shadow;
schar_T border_chars[8];
int border_hl_ids[8];
int border_attr[8];
AlignTextPos title_pos;
VirtText title_chunks;
int title_width;
bool noautocmd;
} FloatConfig;