Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 22 additions & 9 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<boolean>('allowJumpingToWordlessLines', true),
vsConfigOptions.get<StylesConfiguration>('styles', DEFAULT_STYLES)
);
}

let activePromise : Promise<void> | null = null;

const vsConfigOptions = vscode.workspace.getConfiguration('vscode-easymotion');
const config = new Configuration
(
unfocusedTextDecoration,
textDecoration,
vsConfigOptions.get<boolean>('allowJumpingToWordlessLines', true),
vsConfigOptions.get<StylesConfiguration>('styles', DEFAULT_STYLES)
);

let config: Configuration = loadConfig();

let commandContext : ActiveCommandContext | null = null;

const startJump = async (editor: vscode.TextEditor, context: ActiveCommandContext)=>
Expand Down Expand Up @@ -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 () =>
{
Expand Down