Skip to content

Commit

Permalink
api: add a mouse field to Window{Config,Opts} on nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
noib3 committed Oct 24, 2024
1 parent b986c49 commit 06a6adc
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crates/api/src/types/window_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ pub struct WindowConfig {
)]
pub hide: Option<bool>,

#[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<bool>,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -567,6 +578,8 @@ impl TryFrom<WindowOpts> for WindowConfig {
footer_pos,
height,
hide,
#[cfg(feature = "neovim-nightly")]
mouse,
noautocmd,
relative,
row,
Expand Down Expand Up @@ -639,6 +652,8 @@ impl TryFrom<WindowOpts> for WindowConfig {
))?,
height: deserialize(height)?,
hide: deserialize(hide)?,
#[cfg(feature = "neovim-nightly")]
mouse,
noautocmd: deserialize(noautocmd)?,
relative,
row: deserialize(row)?,
Expand Down

0 comments on commit 06a6adc

Please sign in to comment.