fix getStyleAtPos() for pos === EOL
This commit is contained in:
parent
3c15521fc2
commit
823926a025
|
@ -641,6 +641,12 @@
|
||||||
const len = styles.length;
|
const len = styles.length;
|
||||||
const end = styles[len - 2];
|
const end = styles[len - 2];
|
||||||
if (pos > end) return;
|
if (pos > end) return;
|
||||||
|
if (pos === end) {
|
||||||
|
return {
|
||||||
|
style: styles[len - 1],
|
||||||
|
index: len - 2,
|
||||||
|
};
|
||||||
|
}
|
||||||
const mid = (pos / end * (len - 1) & ~1) + 1;
|
const mid = (pos / end * (len - 1) & ~1) + 1;
|
||||||
let a = mid;
|
let a = mid;
|
||||||
let b;
|
let b;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user