diff options
author | glepnir <glephunter@gmail.com> | 2023-09-27 17:23:42 +0800 |
---|---|---|
committer | glepnir <glephunter@gmail.com> | 2023-09-30 18:30:23 +0800 |
commit | 4200a0f1678c06c6da4e4cfb0184c29c1174ed21 (patch) | |
tree | 0a76101997ab9b1a13b699abdc65e3f39c8df43c /src/nvim/api | |
parent | dfa8b582a64aa22d3c57261bfcdc970b26cb58f3 (diff) | |
download | rneovim-4200a0f1678c06c6da4e4cfb0184c29c1174ed21.tar.gz rneovim-4200a0f1678c06c6da4e4cfb0184c29c1174ed21.tar.bz2 rneovim-4200a0f1678c06c6da4e4cfb0184c29c1174ed21.zip |
feat(float): support toggle show float window
Diffstat (limited to 'src/nvim/api')
-rw-r--r-- | src/nvim/api/keysets.h | 1 | ||||
-rw-r--r-- | src/nvim/api/win_config.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/api/keysets.h b/src/nvim/api/keysets.h index 236e75983e..429826f231 100644 --- a/src/nvim/api/keysets.h +++ b/src/nvim/api/keysets.h @@ -113,6 +113,7 @@ typedef struct { String style; Boolean noautocmd; Boolean fixed; + Boolean hide; } Dict(float_config); typedef struct { diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c index ea0b7ce512..60d32eb30d 100644 --- a/src/nvim/api/win_config.c +++ b/src/nvim/api/win_config.c @@ -165,6 +165,7 @@ /// calling this function. /// - fixed: If true when anchor is NW or SW, the float window /// would be kept fixed even if the window would be truncated. +/// - hide: If true the floating window will be hidden. /// /// @param[out] err Error details, if any /// @@ -323,6 +324,7 @@ Dictionary nvim_win_get_config(Window window, Error *err) PUT(rv, "focusable", BOOLEAN_OBJ(config->focusable)); PUT(rv, "external", BOOLEAN_OBJ(config->external)); + PUT(rv, "hide", BOOLEAN_OBJ(config->hide)); if (wp->w_floating) { PUT(rv, "width", INTEGER_OBJ(config->width)); @@ -848,6 +850,10 @@ static bool parse_float_config(Dict(float_config) *config, FloatConfig *fconfig, fconfig->fixed = config->fixed; } + if (HAS_KEY_X(config, hide)) { + fconfig->hide = config->hide; + } + return true; #undef HAS_KEY_X } |