()
| 1933 | } |
| 1934 | |
| 1935 | private moveWordBackwards(): void { |
| 1936 | this.lastAction = null; |
| 1937 | const currentLine = this.state.lines[this.state.cursorLine] || ""; |
| 1938 | |
| 1939 | // If at start of line, move to end of previous line |
| 1940 | if (this.state.cursorCol === 0) { |
| 1941 | if (this.state.cursorLine > 0) { |
| 1942 | this.state.cursorLine--; |
| 1943 | const prevLine = this.state.lines[this.state.cursorLine] || ""; |
| 1944 | this.setCursorCol(prevLine.length); |
| 1945 | } |
| 1946 | return; |
| 1947 | } |
| 1948 | |
| 1949 | this.setCursorCol( |
| 1950 | findWordBackward(currentLine, this.state.cursorCol, { |
| 1951 | segment: (text) => this.segment(text, "word"), |
| 1952 | isAtomicSegment: isPasteMarker, |
| 1953 | }), |
| 1954 | ); |
| 1955 | } |
| 1956 | |
| 1957 | /** |
| 1958 | * Yank (paste) the most recent kill ring entry at cursor position. |
no test coverage detected