diff --git a/src/extension.ts b/src/extension.ts index dc81ec0..59c5c11 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -19,17 +19,22 @@ export function activate(context: vscode.ExtensionContext) opacity: '0' }); + const loadConfig = () => + { + const vsConfigOptions = vscode.workspace.getConfiguration('vscode-easymotion'); + return new Configuration + ( + unfocusedTextDecoration, + textDecoration, + vsConfigOptions.get('allowJumpingToWordlessLines', true), + vsConfigOptions.get('styles', DEFAULT_STYLES) + ); + } + let activePromise : Promise | null = null; - const vsConfigOptions = vscode.workspace.getConfiguration('vscode-easymotion'); - const config = new Configuration - ( - unfocusedTextDecoration, - textDecoration, - vsConfigOptions.get('allowJumpingToWordlessLines', true), - vsConfigOptions.get('styles', DEFAULT_STYLES) - ); - + let config: Configuration = loadConfig(); + let commandContext : ActiveCommandContext | null = null; const startJump = async (editor: vscode.TextEditor, context: ActiveCommandContext)=> @@ -64,6 +69,14 @@ export function activate(context: vscode.ExtensionContext) commandContext = null; }; + vscode.workspace.onDidChangeConfiguration(event => + { + if (event.affectsConfiguration('vscode-easymotion')) + { + config = loadConfig(); + } + }); + // Jump to Word Command context.subscriptions.push(vscode.commands.registerCommand('vscode-easymotion.jumpToWord', async () => {