Commit 13ddccb
authored
Reorder less eagerly (#57)
Update findGap to search for gaps closer to the original position. Previously, we always searched towards the top of the document for gaps, which meant that you would reorder _up_ as soon as you overlapped with the node above you. Now, we weight searches by how far into the parent node the position is, so you don't reorder up until you've moved halfway up the node (by position).
Also we were checking `isTextblock` in findGap but we wanted `isBlock`.1 parent 6182c7b commit 13ddccb
2 files changed
Lines changed: 13 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
70 | 79 | | |
71 | 80 | | |
72 | 81 | | |
| |||
0 commit comments