patch 8.0.1123: cannot define a toolbar for a window
Problem: Cannot define a toolbar for a window.
Solution: Add a window-local toolbar.
diff --git a/src/structs.h b/src/structs.h
index 18a047c..94d7391 100644
--- a/src/structs.h
+++ b/src/structs.h
@@ -70,6 +70,10 @@
typedef struct file_buffer buf_T; /* forward declaration */
typedef struct terminal_S term_T;
+#ifdef FEAT_MENU
+typedef struct VimMenu vimmenu_T;
+#endif
+
/*
* Reference to a buffer that stores the value of buf_free_count.
* bufref_valid() only needs to check "buf" when the count differs.
@@ -2611,6 +2615,14 @@
#endif
};
+#ifdef FEAT_MENU
+typedef struct {
+ int wb_startcol;
+ int wb_endcol;
+ vimmenu_T *wb_menu;
+} winbar_item_T;
+#endif
+
/*
* Structure which contains all information that belongs to a window
*
@@ -2686,7 +2698,7 @@
*/
int w_winrow; /* first row of window in screen */
int w_height; /* number of rows in window, excluding
- status/command line(s) */
+ status/command/winbar line(s) */
int w_status_height; /* number of status lines (0 or 1) */
int w_wincol; /* Leftmost column of window in screen.
use W_WINCOL() */
@@ -2798,6 +2810,12 @@
char_u *w_localdir; /* absolute path of local directory or
NULL */
+#ifdef FEAT_MENU
+ vimmenu_T *w_winbar; /* The root of the WinBar menu hierarchy. */
+ winbar_item_T *w_winbar_items; /* list of items in the WinBar */
+ int w_winbar_height; /* 1 if there is a window toolbar */
+#endif
+
/*
* Options local to a window.
* They are local because they influence the layout of the window or
@@ -3064,8 +3082,6 @@
/* Start a menu name with this to not include it on the main menu bar */
#define MNU_HIDDEN_CHAR ']'
-typedef struct VimMenu vimmenu_T;
-
struct VimMenu
{
int modes; /* Which modes is this menu visible for? */