aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api
diff options
context:
space:
mode:
authorglepnir <glephunter@gmail.com>2023-09-14 13:30:51 +0800
committerglepnir <glephunter@gmail.com>2023-09-18 18:21:14 +0800
commitfd08fd3de3020647c8ae73f1c7d2cf9a4926c828 (patch)
treed6ea15fe5c720985f146431cac3587ced8516ced /src/nvim/api
parenta6e74c1f0a2bbf03f5b99c167b549018f4c8fb0d (diff)
downloadrneovim-fd08fd3de3020647c8ae73f1c7d2cf9a4926c828.tar.gz
rneovim-fd08fd3de3020647c8ae73f1c7d2cf9a4926c828.tar.bz2
rneovim-fd08fd3de3020647c8ae73f1c7d2cf9a4926c828.zip
fix(float): add fixd option
Diffstat (limited to 'src/nvim/api')
-rw-r--r--src/nvim/api/keysets.h1
-rw-r--r--src/nvim/api/win_config.c6
2 files changed, 7 insertions, 0 deletions
diff --git a/src/nvim/api/keysets.h b/src/nvim/api/keysets.h
index 4e5e7af619..736ca9ce07 100644
--- a/src/nvim/api/keysets.h
+++ b/src/nvim/api/keysets.h
@@ -112,6 +112,7 @@ typedef struct {
String footer_pos;
String style;
Boolean noautocmd;
+ Boolean fixed;
} Dict(float_config);
typedef struct {
diff --git a/src/nvim/api/win_config.c b/src/nvim/api/win_config.c
index ac27554172..74c5228329 100644
--- a/src/nvim/api/win_config.c
+++ b/src/nvim/api/win_config.c
@@ -160,6 +160,8 @@
/// - noautocmd: If true then no buffer-related autocommand events such as
/// |BufEnter|, |BufLeave| or |BufWinEnter| may fire from
/// 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.
///
/// @param[out] err Error details, if any
///
@@ -841,6 +843,10 @@ static bool parse_float_config(Dict(float_config) *config, FloatConfig *fconfig,
fconfig->noautocmd = config->noautocmd;
}
+ if (HAS_KEY_X(config, fixed)) {
+ fconfig->fixed = config->fixed;
+ }
+
return true;
#undef HAS_KEY_X
}