diff --git a/.prettierignore b/.prettierignore index a8a0890..b36db63 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,6 @@ *.* +!*.css !*.json !*.mjs -!*.scss !*.ts package-lock.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ae5b41..509b0cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- Removed unnecessary sleep function + ## [1.1.0] - 2025-03-19 ### Changed diff --git a/src/settings.ts b/src/settings.ts index 77e8c72..8c1e12c 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -26,7 +26,6 @@ import { PluginSettingTab, Setting } from "obsidian"; import { CommandLineContext } from "./command"; import CommandLinePlugin from "./main"; -import * as util from "./util"; const RELOAD_DELAY = 500; @@ -62,7 +61,7 @@ export class CommandLineSettingsTab extends PluginSettingTab { .onChange(async (value) => { this.plugin.settings.highlight = value; await this.plugin.saveSettings(); - await util.sleep(RELOAD_DELAY).then(() => { + await sleep(RELOAD_DELAY).then(() => { location.reload(); }); }); diff --git a/src/util.ts b/src/util.ts index b24184c..97935a3 100644 --- a/src/util.ts +++ b/src/util.ts @@ -44,10 +44,6 @@ export function mapTail(array: T[], callbackFn: (thisArg: T) => T): T[] { }, [] as T[]); } -export function sleep(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} - export function waitForGlobal(name: string, delay = 100): Promise { return new Promise((resolve) => { (function resolver() {