mirror of
https://github.com/kotaindah55/extended-markdown-syntax.git
synced 2026-07-22 05:38:06 +00:00
refactor: token index cache no longer needed
This commit is contained in:
parent
fcce761c21
commit
9c424d9a51
1 changed files with 1 additions and 7 deletions
|
|
@ -11,7 +11,7 @@ import { ActivityRecord } from "src/editor-mode/cm-extensions";
|
|||
import { LineBreak, HiddenWidget, ColorButton } from "src/editor-mode/decorator/widgets";
|
||||
import { REVEALED_SPOILER_DECO } from "src/editor-mode/decorator/decorations";
|
||||
import { getTagRange, iterTokenGroup, provideTokenPartsRanges } from "src/editor-mode/utils/token-utils"
|
||||
import { TextCursor } from "../utils/doc-utils";
|
||||
import { TextCursor } from "src/editor-mode/utils/doc-utils";
|
||||
|
||||
interface RangeSetUpdate<T extends RangeValue> {
|
||||
add?: readonly Range<T>[];
|
||||
|
|
@ -200,10 +200,6 @@ export class DecorationBuilder {
|
|||
private readonly _lineBreakReplacer: _LineBreakReplacer;
|
||||
private readonly _selectionObserver: SelectionObserver;
|
||||
private readonly _settings: PluginSettings;
|
||||
private readonly _indexCaches = {
|
||||
inlineToken: { number: 0 }, // 0-based
|
||||
blockToken: { number: 0 } // 0-based
|
||||
}
|
||||
|
||||
public readonly holder: _DecorationHolder;
|
||||
|
||||
|
|
@ -322,7 +318,6 @@ export class DecorationBuilder {
|
|||
iterTokenGroup({
|
||||
tokens: this._parser.inlineTokens,
|
||||
ranges: visibleRanges,
|
||||
indexCache: this._indexCaches.inlineToken,
|
||||
callback: token => {
|
||||
if (token.status != TokenStatus.ACTIVE) return;
|
||||
if (token.type == Format.HIGHLIGHT) hlTokens.push(token);
|
||||
|
|
@ -354,7 +349,6 @@ export class DecorationBuilder {
|
|||
iterTokenGroup({
|
||||
tokens: this._parser.blockTokens,
|
||||
ranges: visibleRanges,
|
||||
indexCache: this._indexCaches.blockToken,
|
||||
callback: token => {
|
||||
if (token.status != TokenStatus.ACTIVE) return;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue