()
| 166 | } |
| 167 | |
| 168 | moveToPreviousDiff() { |
| 169 | const cursorLineNumber = this.editor.getCursorBufferPosition().row + 1; |
| 170 | let previousDiffLineNumber = null; |
| 171 | let lastDiffLineNumber = null; |
| 172 | for (const { newStart } of this.diffs) { |
| 173 | if (newStart < cursorLineNumber) { |
| 174 | previousDiffLineNumber = Math.max(newStart - 1, previousDiffLineNumber); |
| 175 | } |
| 176 | lastDiffLineNumber = Math.max(newStart - 1, lastDiffLineNumber); |
| 177 | } |
| 178 | |
| 179 | // Wrap around to the last diff in the file |
| 180 | if ( |
| 181 | atom.config.get('git-diff.wrapAroundOnMoveToDiff') && |
| 182 | previousDiffLineNumber === null |
| 183 | ) { |
| 184 | previousDiffLineNumber = lastDiffLineNumber; |
| 185 | } |
| 186 | |
| 187 | this.moveToLineNumber(previousDiffLineNumber); |
| 188 | } |
| 189 | |
| 190 | updateIconDecoration() { |
| 191 | const gutter = this.editorElement.querySelector('.gutter'); |
nothing calls this directly
no test coverage detected