diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2017-04-26 15:28:10 +0200 |
---|---|---|
committer | Björn Linse <bjorn.linse@gmail.com> | 2019-03-02 16:29:50 +0100 |
commit | 9a1675b065394734ddaef91a314896028e2b1d46 (patch) | |
tree | a8e869da9a89592dd69a806c19dbeacef84f9bf4 /src/nvim/buffer_defs.h | |
parent | 018e0d5a19c3f710f41a78bcbb0c6e3e393a5ed8 (diff) | |
download | rneovim-9a1675b065394734ddaef91a314896028e2b1d46.tar.gz rneovim-9a1675b065394734ddaef91a314896028e2b1d46.tar.bz2 rneovim-9a1675b065394734ddaef91a314896028e2b1d46.zip |
floats: implement floating windows
Co-Author: Dongdong Zhou <dzhou121@gmail.com>
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r-- | src/nvim/buffer_defs.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index da1e3ce9c6..48cef9b1e7 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -958,6 +958,35 @@ struct matchitem { int conceal_char; ///< cchar for Conceal highlighting }; +typedef enum { + kFloatAnchorEast = 1, + kFloatAnchorSouth = 2, + + kFloatAnchorNW = 0, + kFloatAnchorNE = 1, + kFloatAnchorSW = 2, + kFloatAnchorSE = 3, +} FloatAnchor; + +typedef enum { + kFloatRelativeEditor = 0, + kFloatRelativeWindow = 1, + kFloatRelativeCursor = 2, +} FloatRelative; + +typedef struct { + Window window; + double row, col; + FloatAnchor anchor; + FloatRelative relative; + bool external; + bool focusable; +} FloatConfig; + +#define FLOAT_CONFIG_INIT ((FloatConfig){ .row = 0, .col = 0, .anchor = 0, \ + .relative = 0, .external = false, \ + .focusable = true }) + /* * Structure which contains all information that belongs to a window * @@ -1221,6 +1250,8 @@ struct window_S { ScreenGrid w_grid; // the grid specific to the window bool w_pos_changed; // true if window position changed + bool w_floating; ///< whether the window is floating + FloatConfig w_float_config; /* * w_fraction is the fractional row of the cursor within the window, from |