Fix names

This commit is contained in:
Andras Schmelczer 2025-07-06 12:40:26 +01:00
parent 98dc11896e
commit 6b6b16af3c
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C
5 changed files with 13 additions and 21 deletions

View file

@ -30,7 +30,7 @@ impl CursorPosition {
#[must_use]
pub fn id(&self) -> usize { self.id }
#[cfg_attr(feature = "wasm", wasm_bindgen(js_name = characterPosition))]
#[cfg_attr(feature = "wasm", wasm_bindgen(js_name = characterIndex))]
#[must_use]
pub fn char_index(&self) -> usize { self.char_index }
}

View file

@ -5,19 +5,20 @@ use wasm_bindgen::prelude::*;
use crate::types::history::History;
/// Wrapper type for `(History, String)`
/// Wrapper type for `(String, History)` where History describes the origin of
/// `text`.
#[cfg_attr(feature = "wasm", wasm_bindgen)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Debug, Clone, PartialEq)]
pub struct SpanWithHistory {
history: History,
text: String,
history: History,
}
#[cfg_attr(feature = "wasm", wasm_bindgen)]
impl SpanWithHistory {
#[must_use]
pub fn new(history: History, text: String) -> Self { SpanWithHistory { history, text } }
pub fn new(text: String, history: History) -> Self { SpanWithHistory { text, history } }
#[must_use]
pub fn history(&self) -> History { self.history }