fix: remove panic

This commit is contained in:
Nik Revenco 2025-03-20 08:25:21 +00:00
parent 74e08a67ad
commit 50bdfbe35c

View file

@ -93,10 +93,13 @@ pub(super) fn register_hooks(handlers: &Handlers) {
return Ok(()); return Ok(());
}; };
let hunks = doc.diff_handle().unwrap().load(); let Some(hunks) = doc.diff_handle() else {
return Ok(());
};
let (inserted_lines_count, deleted_lines_count) = let (inserted_lines_count, deleted_lines_count) = hunks
hunks.inserted_and_deleted_before_line(cursor_line as usize); .load()
.inserted_and_deleted_before_line(cursor_line as usize);
send_blocking( send_blocking(
&tx, &tx,