Skip to main content

delete_word

Function delete_word 

Source
pub fn delete_word(body: &mut TextBody, pos: Pos, forward: bool) -> Pos
Expand description

Delete a word from pos as Ctrl+Backspace (forward == false) or Ctrl+Delete does in PowerPoint; returns the caret.

Ctrl+Backspace deletes back to the previous word stop (at a paragraph’s start it joins the paragraph to the one before). Ctrl+Delete deletes the rest of the word, or the spaces after a word and the next word, or up to the next stop (see words::delete_forward_end), then tidies the spacing as PowerPoint’s smart cut does: spaces left before closing punctuation or at the end of the paragraph after a word go, and sentence punctuation left against a word gets a space. At a paragraph’s end it joins the next paragraph.