From 06a6adc00c4c1420309a13a848fd2c5bb1d92b9b Mon Sep 17 00:00:00 2001 From: Riccardo Mazzarini Date: Thu, 24 Oct 2024 17:49:11 +0800 Subject: [PATCH] api: add a `mouse` field to `Window{Config,Opts}` on nightly [Upstream](https://github.com/neovim/neovim/commit/9b8907d90508d7b66f025bbd1f5a48a78c5ce035). --- crates/api/src/types/window_config.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/crates/api/src/types/window_config.rs b/crates/api/src/types/window_config.rs index 90581640..ea77b5f2 100644 --- a/crates/api/src/types/window_config.rs +++ b/crates/api/src/types/window_config.rs @@ -75,6 +75,11 @@ pub struct WindowConfig { )] pub hide: Option, + #[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] + #[cfg(feature = "neovim-nightly")] // On 0.10 and nightly. + #[serde(default)] + pub mouse: bool, + /// If `true` then no buffer-related autocommand events such as `BufEnter` /// or `BufLeave` are fired when calling [`open_win`](crate::open_win). pub noautocmd: Option, @@ -436,6 +441,9 @@ pub struct WindowOpts { bufpos: Array, external: Boolean, focusable: Boolean, + #[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))] + #[cfg(feature = "neovim-nightly")] + mouse: Boolean, vertical: Boolean, zindex: Integer, border: Object, @@ -501,6 +509,9 @@ impl From<&WindowConfig> for WindowOpts { builder.focusable(focusable); } + #[cfg(feature = "neovim-nightly")] + builder.mouse(config.mouse); + if let Some(vertical) = config.vertical { builder.vertical(vertical); } @@ -567,6 +578,8 @@ impl TryFrom for WindowConfig { footer_pos, height, hide, + #[cfg(feature = "neovim-nightly")] + mouse, noautocmd, relative, row, @@ -639,6 +652,8 @@ impl TryFrom for WindowConfig { ))?, height: deserialize(height)?, hide: deserialize(hide)?, + #[cfg(feature = "neovim-nightly")] + mouse, noautocmd: deserialize(noautocmd)?, relative, row: deserialize(row)?,