Do not skip lines marked as dueToMove
Background: gr-diff-cursor relies on the specific dom strucutre to
identify what is a proper cursor stop as "next/previous" chunk.
We added a new row (tr element) with moveControls (that show moved in/
out). We should take that into account.
Change-Id: Ie2a6e408fc95c01f3e96395c41c00bbe71076602
diff --git a/polygerrit-ui/app/elements/diff/gr-diff-cursor/gr-diff-cursor.ts b/polygerrit-ui/app/elements/diff/gr-diff-cursor/gr-diff-cursor.ts
index 2486c03..5d26899 100644
--- a/polygerrit-ui/app/elements/diff/gr-diff-cursor/gr-diff-cursor.ts
+++ b/polygerrit-ui/app/elements/diff/gr-diff-cursor/gr-diff-cursor.ts
@@ -449,11 +449,12 @@
_isFirstRowOfChunk(row: HTMLElement) {
const parentClassList = (row.parentNode as HTMLElement).classList;
- return (
- parentClassList.contains('section') &&
- parentClassList.contains('delta') &&
- !row.previousSibling
- );
+ const isInChunk =
+ parentClassList.contains('section') && parentClassList.contains('delta');
+ const previousRow = row.previousSibling as HTMLElement;
+ const firstContentRow =
+ !previousRow || previousRow.classList.contains('moveControls');
+ return isInChunk && firstContentRow;
}
_rowHasThread(row: HTMLElement): boolean {