Fix Nightly (#219)

This commit is contained in:
Riccardo Mazzarini 2025-03-05 07:35:32 +08:00 committed by GitHub
parent 6f5f735099
commit f751ef4324
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 60 additions and 21 deletions

View file

@ -1,6 +1,8 @@
use types::{Array, Integer}; use types::{Array, Integer};
use crate::trait_utils::StringOrListOfStrings; use crate::trait_utils::StringOrListOfStrings;
#[cfg(feature = "neovim-nightly")]
use crate::types::VirtLinesOverflow;
use crate::types::{ExtmarkHlMode, ExtmarkVirtTextPosition}; use crate::types::{ExtmarkHlMode, ExtmarkVirtTextPosition};
/// Options passed to [`Buffer::set_extmark()`](crate::Buffer::set_extmark). /// Options passed to [`Buffer::set_extmark()`](crate::Buffer::set_extmark).
@ -425,6 +427,12 @@ pub struct SetExtmarkOpts {
#[builder(argtype = "bool")] #[builder(argtype = "bool")]
virt_lines_leftcol: types::Boolean, virt_lines_leftcol: types::Boolean,
/// Controls how to handle virtual lines wider than the window.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))]
#[cfg(feature = "neovim-nightly")]
#[builder(argtype = "VirtLinesOverflow", inline = "{0}.into()")]
virt_lines_overflow: types::String,
/// Whether the extmark should not be placed if the line or column value is /// Whether the extmark should not be placed if the line or column value is
/// past the end of the buffer or end of the line, respectively. Defaults /// past the end of the buffer or end of the line, respectively. Defaults
/// to `true`. /// to `true`.
@ -479,6 +487,13 @@ pub struct SetExtmarkOpts {
)] )]
conceal: types::String, conceal: types::String,
/// When called, lines in the range are not drawn at all (according to
/// `conceallevel`); the next unconcealed line is drawn instead.
#[cfg_attr(docsrs, doc(cfg(feature = "neovim-nightly")))]
#[cfg(feature = "neovim-nightly")]
#[builder(argtype = "()", inline = "{let _ = {0}; types::String::new()}")]
conceal_lines: types::String,
#[builder(argtype = "bool")] #[builder(argtype = "bool")]
spell: types::Boolean, spell: types::Boolean,

View file

@ -43,6 +43,8 @@ mod statusline_highlight_infos;
mod statusline_infos; mod statusline_infos;
mod ui_infos; mod ui_infos;
mod viml_ast_node; mod viml_ast_node;
#[cfg(feature = "neovim-nightly")] // On Nightly.
mod virt_lines_overflow;
#[cfg(feature = "neovim-0-10")] // On 0.10 and nightly. #[cfg(feature = "neovim-0-10")] // On 0.10 and nightly.
mod win_text_height_infos; mod win_text_height_infos;
mod window_anchor; mod window_anchor;
@ -97,6 +99,8 @@ pub use statusline_highlight_infos::*;
pub use statusline_infos::*; pub use statusline_infos::*;
pub use ui_infos::*; pub use ui_infos::*;
pub use viml_ast_node::*; pub use viml_ast_node::*;
#[cfg(feature = "neovim-nightly")] // On Nightly.
pub use virt_lines_overflow::VirtLinesOverflow;
#[cfg(feature = "neovim-0-10")] // On 0.10 and nightly. #[cfg(feature = "neovim-0-10")] // On 0.10 and nightly.
pub use win_text_height_infos::*; pub use win_text_height_infos::*;
pub use window_anchor::*; pub use window_anchor::*;

View file

@ -0,0 +1,20 @@
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum VirtLinesOverflow {
Scroll,
Trunc,
}
impl VirtLinesOverflow {
fn as_str(&self) -> &'static str {
match self {
Self::Scroll => "scroll",
Self::Trunc => "trunk",
}
}
}
impl From<VirtLinesOverflow> for types::String {
fn from(virt_lines_overflow: VirtLinesOverflow) -> Self {
virt_lines_overflow.as_str().into()
}
}

42
flake.lock generated
View file

@ -40,11 +40,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736143030, "lastModified": 1738453229,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -62,11 +62,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736143030, "lastModified": 1738453229,
"narHash": "sha256-+hu54pAoLDEZT9pjHlqL9DNzWz0NbUn8NEAHP7PQPzU=", "narHash": "sha256-7H9XgNiGLKN1G1CgRh0vUL4AheZSYzPm+zmZ7vxbJdo=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "b905f6fc23a9051a6e1b741e1438dbfc0634c6de", "rev": "32ea77a06711b758da0ad9bd6a844c5740a87abd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -146,11 +146,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1736917206, "lastModified": 1739595404,
"narHash": "sha256-JTBWmyGf8K1Rwb+gviHIUzRJk/sITtT+72HXFkTZUjo=", "narHash": "sha256-0CjCfbq0yHWexOrpO06e2WU1r5JAqR6ffy1zgM3NksI=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "hercules-ci-effects", "repo": "hercules-ci-effects",
"rev": "afd0a42e8c61ebb56899315ee4084a8b2e4ff425", "rev": "06519cec8fb32d219006da6eacd255504a9996af",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -172,11 +172,11 @@
"treefmt-nix": "treefmt-nix" "treefmt-nix": "treefmt-nix"
}, },
"locked": { "locked": {
"lastModified": 1737614530, "lastModified": 1740647326,
"narHash": "sha256-s5+trj2UfrIWlrCm+hKDB5+36kY5scH9MxM9zfU+4qc=", "narHash": "sha256-sna9JSHxSGqb2y+qW4cX8Tjd/jJm0gJbwnsd7RPu3H4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "neovim-nightly-overlay", "repo": "neovim-nightly-overlay",
"rev": "7d9aaf2f175602b8511e4c5134c4a975628c6948", "rev": "18b8e8cca2aa0a21ded8a42423df4fb9efd24117",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -189,11 +189,11 @@
"neovim-src": { "neovim-src": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1737560784, "lastModified": 1740610854,
"narHash": "sha256-bW3ub7hI5Ml+4cFErZvlbbQNDmmycoroRYYAegj33qo=", "narHash": "sha256-pQ8BBwNdVjbiK3YgQc6twbL/1crXtM/jM9whvc6T9i8=",
"owner": "neovim", "owner": "neovim",
"repo": "neovim", "repo": "neovim",
"rev": "af0ef2ac9dd19b7c4005a3197334d3e7d554646c", "rev": "3cce6570312830dfab9efd9d521125f0049ad55f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -204,11 +204,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1737469691, "lastModified": 1740560979,
"narHash": "sha256-nmKOgAU48S41dTPIXAq0AHZSehWUn6ZPrUKijHAMmIk=", "narHash": "sha256-Vr3Qi346M+8CjedtbyUevIGDZW8LcA1fTG0ugPY/Hic=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "9e4d5190a9482a1fb9d18adf0bdb83c6e506eaab", "rev": "5135c59491985879812717f4c9fea69604e7f26f",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -248,11 +248,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1737483750, "lastModified": 1739829690,
"narHash": "sha256-5An1wq5U8sNycOBBg3nsDDgpwBmR9liOpDGlhliA6Xo=", "narHash": "sha256-mL1szCeIsjh6Khn3nH2cYtwO5YXG6gBiTw1A30iGeDU=",
"owner": "numtide", "owner": "numtide",
"repo": "treefmt-nix", "repo": "treefmt-nix",
"rev": "f2cc121df15418d028a59c9737d38e3a90fbaf8f", "rev": "3d0579f5cc93436052d94b73925b48973a104204",
"type": "github" "type": "github"
}, },
"original": { "original": {