ytext_insert_delta

Function ytext_insert_delta 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn ytext_insert_delta( txt: *const Branch, txn: *mut Transaction, delta: *mut YDeltaIn, delta_len: u32, )
Expand description

Performs a series of changes over the given YText shared ref type, described by the delta parameter:

  • Deltas constructed with ydelta_input_retain will move cursor position by the given number of elements. If formatting attributes were defined, all elements skipped over this way will be wrapped by given formatting attributes.
  • Deltas constructed with ydelta_input_delete will tell cursor to remove a corresponding number of elements.
  • Deltas constructed with ydelta_input_insert will tell cursor to insert given elements into current cursor position. While these elements can be of any type (used for embedding ie. shared types or binary payload like images), for the text insertion a yinput_string is expected. If formatting attributes were specified, inserted elements will be wrapped by given formatting attributes.