nvim_api/types/
extmark_position.rs1use nvim_types::{Array, Integer, Object};
2use serde::Deserialize;
3
4#[non_exhaustive]
5#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Deserialize)]
6pub enum ExtmarkPosition {
7 ByTuple((usize, usize)),
10
11 ById(u32),
13}
14
15impl From<ExtmarkPosition> for Object {
16 fn from(pos: ExtmarkPosition) -> Self {
17 use ExtmarkPosition::*;
18
19 match pos {
20 ByTuple((row, col)) => {
21 Array::from_iter([row as Integer, col as Integer]).into()
22 },
23 ById(extmark_id) => extmark_id.into(),
24 }
25 }
26}