diff --git a/package.json b/package.json index 6d388bb..58a8477 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "displayName": "Inline fold", "description": "A custom decorator that \"fold\" matching content in single line", "icon": "res/icon.png", - "version": "0.2.3", + "version": "0.2.4", "publisher": "moalamri", "homepage": "https://github.com/moalamri/vscode-inline-fold", "bugs": "https://github.com/moalamri/vscode-inline-fold/issues", @@ -105,7 +105,7 @@ ] }, "inlineFold.regexGroup": { - "type": "string", + "type": ["string", "number"], "scope": "language-overridable", "description": "Regex capture group number for content that will be folded", "default": "6", diff --git a/src/decorator.ts b/src/decorator.ts index 27d62c5..9f3ec21 100644 --- a/src/decorator.ts +++ b/src/decorator.ts @@ -11,7 +11,7 @@ export class Decorator { CurrentEditor: TextEditor; ParsedRegexString: string; SupportedLanguages: string[] = []; - Offset: number = 30; + Offset: number = 50; StartLine: number = 0; EndLine: number = 0; diff --git a/src/extension.ts b/src/extension.ts index a0acc64..4afd10d 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -32,10 +32,6 @@ export function activate(context: ExtensionContext) { }); const changeSelection = window.onDidChangeTextEditorSelection((e) => { - // event.kind is undefined when the selection change happens from tab switch or undo/redo - // good to limit the number of times the decoration is updated, so no need - // to fire the event if it's undefined - if (!e.kind) return; elimit.Lead(); }); @@ -48,8 +44,8 @@ export function activate(context: ExtensionContext) { // e.reason = 1 when undo // e.reason = 2 when redo // this event gets fired when any change happens to any text document in the workspace - // so we will limit it to only update the decoration when the change is caused by undo/redo - // also because `changeSelection` gets fired as well while typing. + // so to limit the decoration it will fire when the change is caused by undo/redo + // since `changeSelection` gets fired as well while typing or moving lines. if (e.reason !== 1 && e.reason !== 2) return; elimit.Trail(); });