mirror of
https://github.com/kotaindah55/extended-markdown-syntax.git
synced 2026-07-22 05:38:06 +00:00
feat: pick certain tokens from the maps based on their format type
This commit is contained in:
parent
7937dbaabb
commit
a6c44bd794
1 changed files with 6 additions and 1 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue