()
| 138 | } |
| 139 | |
| 140 | moveToNextDiff() { |
| 141 | const cursorLineNumber = this.editor.getCursorBufferPosition().row + 1; |
| 142 | let nextDiffLineNumber = null; |
| 143 | let firstDiffLineNumber = null; |
| 144 | |
| 145 | for (const { newStart } of this.diffs) { |
| 146 | if (newStart > cursorLineNumber) { |
| 147 | if (nextDiffLineNumber == null) nextDiffLineNumber = newStart - 1; |
| 148 | |
| 149 | nextDiffLineNumber = Math.min(newStart - 1, nextDiffLineNumber); |
| 150 | } |
| 151 | |
| 152 | if (firstDiffLineNumber == null) firstDiffLineNumber = newStart - 1; |
| 153 | |
| 154 | firstDiffLineNumber = Math.min(newStart - 1, firstDiffLineNumber); |
| 155 | } |
| 156 | |
| 157 | // Wrap around to the first diff in the file |
| 158 | if ( |
| 159 | atom.config.get('git-diff.wrapAroundOnMoveToDiff') && |
| 160 | nextDiffLineNumber == null |
| 161 | ) { |
| 162 | nextDiffLineNumber = firstDiffLineNumber; |
| 163 | } |
| 164 | |
| 165 | this.moveToLineNumber(nextDiffLineNumber); |
| 166 | } |
| 167 | |
| 168 | moveToPreviousDiff() { |
| 169 | const cursorLineNumber = this.editor.getCursorBufferPosition().row + 1; |
nothing calls this directly
no test coverage detected