Skip to content

Commit

Permalink
Reflect internal col variable calculation (#231)
Browse files Browse the repository at this point in the history
Co-authored-by: ocavue <[email protected]>
  • Loading branch information
zunsthy and ocavue authored Jul 2, 2024
1 parent 3fb40e0 commit 67fd9b1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/columnresizing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,15 @@ export function handleDecorations(
}
const map = TableMap.get(table);
const start = $cell.start(-1);
const col = map.colCount($cell.pos - start) + $cell.nodeAfter!.attrs.colspan;
const col =
map.colCount($cell.pos - start) + $cell.nodeAfter!.attrs.colspan - 1;
for (let row = 0; row < map.height; row++) {
const index = col + row * map.width - 1;
const index = col + row * map.width;
// For positions that have either a different cell or the end
// of the table to their right, and either the top of the table or
// a different cell above them, add a decoration
if (
(col == map.width || map.map[index] != map.map[index + 1]) &&
(col == map.width - 1 || map.map[index] != map.map[index + 1]) &&
(row == 0 || map.map[index] != map.map[index - map.width])
) {
const cellPos = map.map[index];
Expand Down

0 comments on commit 67fd9b1

Please sign in to comment.