* カーソル位置を前の文字へ戻します。
()
| 74 | * カーソル位置を前の文字へ戻します。 |
| 75 | */ |
| 76 | public prev(): void { |
| 77 | this.movePrev(); |
| 78 | this.decAddr(); |
| 79 | if (!this.startOfFile && this._char === '\n') { |
| 80 | this.line--; |
| 81 | const page = this.pages.get(this.pageIndex)!; |
| 82 | const lastLineBreak = page.lastIndexOf('\n', this.address - 1); |
| 83 | const lineStart = lastLineBreak >= 0 ? lastLineBreak + 1 : 0; |
| 84 | const line = page.slice(lineStart, this.address); |
| 85 | this.column = line.length; |
| 86 | } else { |
| 87 | this.column -= this._char!.length; |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | private get isFirstPage(): boolean { |
| 92 | return (this.pageIndex <= this.firstPageIndex); |