feat: pick certain tokens from the maps based on their format type

This commit is contained in:
kotaindah55 2025-03-17 10:34:12 +02:00
parent 7937dbaabb
commit a6c44bd794

View file

@ -389,8 +389,13 @@ export class SelectionObserver {
}
return false;
}
pickMaps(type: Format) {
let level = isInlineFormat(type) ? TokenLevel.INLINE : TokenLevel.BLOCK,
tokens = this.parser.getTokens(level);
return this.maps.map(maps => maps[level]?.filter(tokenIndex => tokens[tokenIndex].type == type));
}
clearMaps() {
this.maps = [];
this.maps = new Array(this.selection.ranges.length).map(() => ({}));
}
checkSelectionIndexCache() {
if (this.indexCaches.selection.number >= this.selection.ranges.length) {