mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-21 23:04:49 +01:00
docs: fix doctests
This commit is contained in:
parent
7cc8e88402
commit
a73a61a841
2 changed files with 5 additions and 5 deletions
|
@ -31,18 +31,18 @@ pub struct BufferUpdate {
|
|||
/// ### Examples
|
||||
/// To insert 'a' after 4th character we should send:
|
||||
/// ```
|
||||
/// codemp::api::TextChange { start: 4, end: 4, content: "a".into() };
|
||||
/// codemp::api::TextChange { start_idx: 4, end_idx: 4, content: "a".into() };
|
||||
/// ```
|
||||
///
|
||||
/// To delete the fourth character we should send:
|
||||
/// ```
|
||||
/// codemp::api::TextChange { start: 3, end: 4, content: "".into() };
|
||||
/// codemp::api::TextChange { start_idx: 3, end_idx: 4, content: "".into() };
|
||||
/// ```
|
||||
///
|
||||
/// ```
|
||||
/// let change = codemp::api::TextChange {
|
||||
/// start: 6,
|
||||
/// end: 11,
|
||||
/// start_idx: 6,
|
||||
/// end_idx: 11,
|
||||
/// content: "mom".to_string()
|
||||
/// };
|
||||
/// let before = "hello world!";
|
||||
|
|
|
@ -72,7 +72,7 @@
|
|||
//! if let Some(mut update) = buffer.try_recv().await.unwrap() {
|
||||
//! println!(
|
||||
//! "content: {}, span: {}-{}",
|
||||
//! update.change.content, update.change.start, update.change.end
|
||||
//! update.change.content, update.change.start_idx, update.change.end_idx
|
||||
//! );
|
||||
//! buffer.ack(update.version);
|
||||
//! } // if None, no changes are currently available
|
||||
|
|
Loading…
Reference in a new issue