Commit 5687b0f
committed
fix: Fix cursor.isAtLastLine and cursor.isAtFirstLine calculations to respect line breaks
This fixes some issue with range.getClientBoundingRect() that doesn't respect newlines at the start and at the end of a block.
By inserting a temporary element, we get the exact position of current range.
```
<br>
<br>
<!-- The cursor offset basically starts here instead of two lines above with range.getClientBoundingRect() -->
<p>| Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>
<p>Curabitur vitae lobortis ante. Vivamus metus magna<p>
```1 parent 420dfef commit 5687b0f
1 file changed
+22
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
98 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
345 | 347 | | |
346 | 348 | | |
347 | 349 | | |
348 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
349 | 364 | | |
350 | 365 | | |
351 | | - | |
| 366 | + | |
352 | 367 | | |
353 | 368 | | |
354 | 369 | | |
| |||
0 commit comments