()
| 2126 | } |
| 2127 | |
| 2128 | private moveWordForwards(): void { |
| 2129 | this.lastAction = null; |
| 2130 | const currentLine = this.state.lines[this.state.cursorLine] || ""; |
| 2131 | |
| 2132 | // If at end of line, move to start of next line |
| 2133 | if (this.state.cursorCol >= currentLine.length) { |
| 2134 | if (this.state.cursorLine < this.state.lines.length - 1) { |
| 2135 | this.state.cursorLine++; |
| 2136 | this.setCursorCol(0); |
| 2137 | } |
| 2138 | return; |
| 2139 | } |
| 2140 | |
| 2141 | this.setCursorCol( |
| 2142 | findWordForward(currentLine, this.state.cursorCol, { |
| 2143 | segment: (text) => this.segment(text, "word"), |
| 2144 | isAtomicSegment: isPasteMarker, |
| 2145 | }), |
| 2146 | ); |
| 2147 | } |
| 2148 | |
| 2149 | // Slash menu only allowed on the first line of the editor |
| 2150 | private isSlashMenuAllowed(): boolean { |
no test coverage detected