Merge pull request #25386 from glepnir/toggle_float

feat(float): support toggle show float window
This commit is contained in:
bfredl
2023-09-30 13:40:35 +02:00
committed by GitHub
9 changed files with 156 additions and 14 deletions

View File

@@ -113,6 +113,7 @@ typedef struct {
String style;
Boolean noautocmd;
Boolean fixed;
Boolean hide;
} Dict(float_config);
typedef struct {

View File

@@ -167,6 +167,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
///
@@ -325,6 +326,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));
@@ -850,6 +852,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
}