()
| 1316 | } |
| 1317 | |
| 1318 | private addNewLine(): void { |
| 1319 | this.cancelAutocomplete(); |
| 1320 | this.exitHistoryBrowsing(); |
| 1321 | this.lastAction = null; |
| 1322 | |
| 1323 | this.pushUndoSnapshot(); |
| 1324 | |
| 1325 | const currentLine = this.state.lines[this.state.cursorLine] || ""; |
| 1326 | |
| 1327 | const before = currentLine.slice(0, this.state.cursorCol); |
| 1328 | const after = currentLine.slice(this.state.cursorCol); |
| 1329 | |
| 1330 | // Split current line |
| 1331 | this.state.lines[this.state.cursorLine] = before; |
| 1332 | this.state.lines.splice(this.state.cursorLine + 1, 0, after); |
| 1333 | |
| 1334 | // Move cursor to start of new line |
| 1335 | this.state.cursorLine++; |
| 1336 | this.setCursorCol(0); |
| 1337 | |
| 1338 | if (this.onChange) { |
| 1339 | this.onChange(this.getText()); |
| 1340 | } |
| 1341 | } |
| 1342 | |
| 1343 | private shouldSubmitOnBackslashEnter(data: string, kb: ReturnType<typeof getKeybindings>): boolean { |
| 1344 | if (this.disableSubmit) return false; |
no test coverage detected