Fix a crash when there's no cursor cache

pull/6118/merge^2
SoraTenshi 11 months ago
parent 1d0f5d7e26
commit 67bbd65d6c

@ -73,7 +73,10 @@ pub fn calculate_sticky_nodes(
config: &helix_view::editor::Config,
cursor_cache: &Option<Option<Position>>,
) -> Option<Vec<StickyNode>> {
let cursor_cache = cursor_cache.expect("cursor is cached")?;
let Some(cursor_cache) = cursor_cache else {
return None;
};
let cursor_cache = cursor_cache.as_ref()?;
let syntax = doc.syntax()?;
let tree = syntax.tree();

Loading…
Cancel
Save