(text: string, cursor: number)
| 26 | |
| 27 | /** Delete the word immediately left of the cursor (Ctrl+W). Returns new text+cursor. */ |
| 28 | export function deleteWordLeft(text: string, cursor: number): { text: string; cursor: number } { |
| 29 | const start = wordLeft(text, cursor); |
| 30 | return { text: text.slice(0, start) + text.slice(cursor), cursor: start }; |
| 31 | } |
| 32 | |
| 33 | /** Insert `s` at `cursor`. Returns new text and the cursor after the inserted text. */ |
| 34 | export function insertAt(text: string, cursor: number, s: string): { text: string; cursor: number } { |
no test coverage detected