(result)
| 238 | }; |
| 239 | |
| 240 | const apply = (result) => { |
| 241 | if (!result) return false; |
| 242 | writeAndRestore(result.text, result.caretStart ?? result.caret, result.caretEnd ?? result.caret); |
| 243 | autoPairCaret = result.autoPair ?? -1; |
| 244 | return true; |
| 245 | }; |
| 246 | |
| 247 | // Insert plain text at caret, replacing any selection; used by paste/drop after normalisation. Enforces `MAX_LINES`. |
| 248 | const insertAtCaret = (str) => { |
no test coverage detected