Skip to content

Commit

Permalink
fix: spell check not running in Obsidian
Browse files Browse the repository at this point in the history
  • Loading branch information
elijah-potter committed Sep 1, 2024
1 parent 17f9ffd commit 62df083
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
8 changes: 0 additions & 8 deletions harper-wasm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ pub fn setup() {
tracing_wasm::set_as_global_default();
}

/// Configure Harper whether to include spell checking in the linting provided
/// by the [`lint`] function.
#[wasm_bindgen]
pub fn use_spell_check(set: bool) {
let mut linter = LINTER.lock().unwrap();
linter.config.spell_check = Some(set);
}

#[wasm_bindgen]
pub fn get_lint_config_as_object() -> JsValue {
let linter = LINTER.lock().unwrap();
Expand Down
8 changes: 1 addition & 7 deletions packages/obsidian-plugin/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@ import logoSvg from '../logo.svg';
import { linter } from './lint';
import { Plugin, addIcon, Menu } from 'obsidian';
import wasm from 'wasm/harper_wasm_bg.wasm';
import init, {
lint,
use_spell_check,
get_lint_config_as_object,
set_lint_config_from_object
} from 'wasm';
import init, { lint, get_lint_config_as_object, set_lint_config_from_object } from 'wasm';
import { HarperSettingTab } from './HarperSettingTab';

function suggestionToLabel(sug) {
Expand All @@ -29,7 +24,6 @@ const harperLinter = (plugin) =>

await init(await wasm());

use_spell_check(false);
const lints = lint(text);

return lints.map((lint) => {
Expand Down

0 comments on commit 62df083

Please sign in to comment.