refactor(users/Profpatsch/lyric/ext): move command into fn
Change-Id: I2d38455cdf881e03a390d129f9cee3f9eeca485d Reviewed-on: https://cl.tvl.fyi/c/depot/+/12548 Tested-by: BuildkiteCI Reviewed-by: Profpatsch <mail@profpatsch.de>
This commit is contained in:
parent
9bec21ea1c
commit
02713e054f
1 changed files with 40 additions and 38 deletions
|
@ -4,7 +4,11 @@ import * as net from 'net';
|
||||||
export function activate(context: vscode.ExtensionContext) {
|
export function activate(context: vscode.ExtensionContext) {
|
||||||
context.subscriptions.push(...registerCheckLineTimestamp(context));
|
context.subscriptions.push(...registerCheckLineTimestamp(context));
|
||||||
context.subscriptions.push(
|
context.subscriptions.push(
|
||||||
vscode.commands.registerCommand('extension.jumpToLrcPosition', () => {
|
vscode.commands.registerCommand('extension.jumpToLrcPosition', jumpToLrcPosition),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function jumpToLrcPosition() {
|
||||||
const editor = vscode.window.activeTextEditor;
|
const editor = vscode.window.activeTextEditor;
|
||||||
|
|
||||||
if (!editor) {
|
if (!editor) {
|
||||||
|
@ -41,8 +45,6 @@ export function activate(context: vscode.ExtensionContext) {
|
||||||
socket.on('error', err => {
|
socket.on('error', err => {
|
||||||
vscode.window.showErrorMessage(`Failed to send command: ${err.message}`);
|
vscode.window.showErrorMessage(`Failed to send command: ${err.message}`);
|
||||||
});
|
});
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the difference to the timestamp on the next line is larger than 10 seconds, underline the next line and show a warning message on hover
|
// If the difference to the timestamp on the next line is larger than 10 seconds, underline the next line and show a warning message on hover
|
||||||
|
|
Loading…
Reference in a new issue