denisoed / obsidian-orthography

The Obsidian plugin for checking grammar and correcting spelling errors in text.
MIT License
121 stars 4 forks source link

[BUG] Can't close the window about plugin #17

Closed YIRU69 closed 5 months ago

YIRU69 commented 2 years ago

Hi, thanks for you make the plugin. I have a probrom when I use it. 2 I can't close the window about plugin. What's wrong with it?

YIRU69 commented 2 years ago

Hi ,look at the picture. image

denisoed commented 2 years ago

@YIRU69 Hi

The plugin does not work correctly in the "Live Preview" mode :( I'll figure it out and fix it

YIRU69 commented 2 years ago

@VidathD Hi, friend, this is another error that I said. 1 Step:

  1. start to load plugin
  2. check the button Run orthography check in the source mode
  3. and then the error like the gif.
YIRU69 commented 2 years ago
Uncaught TypeError: Cannot read properties of undefined (reading 'getAllMarks')
    at onPopupClose (eval at <anonymous> (app.js:1:1433712), <anonymous>:790:35)
    at e.tryTrigger (app.js:1:838297)
    at e.trigger (app.js:1:838230)
    at OrthographyToggler.setButtonWithRunner (eval at <anonymous> (app.js:1:1433712), <anonymous>:526:24)
    at HTMLButtonElement.toggle (eval at <anonymous> (app.js:1:1433712), <anonymous>:482:20)
onPopupClose @ main.ts:147
e.tryTrigger @ app.js:1
e.trigger @ app.js:1
setButtonWithRunner @ orthographyToggler.ts:107
toggle @ orthographyToggler.ts:56
setTimeout (async)
e.tryTrigger @ app.js:1
e.trigger @ app.js:1
setButtonWithRunner @ orthographyToggler.ts:107
toggle @ orthographyToggler.ts:56
YIRU69 commented 2 years ago

Hope you can quickly to fix it. I love you plugin very much.

denisoed commented 2 years ago

@YIRU69 Please, try changing the mode to "Source mode"

image

YIRU69 commented 2 years ago

@YIRU69 Please, try changing the mode to "Source mode"

image

I am actually on the Source mode!

denisoed commented 2 years ago

@YIRU69 I will fix this bug. Thanks

YIRU69 commented 2 years ago
Uncaught TypeError: this.activeEditor.off is not a function
    at HTMLDocument.eval (eval at <anonymous> (app.js:1:1433712), <anonymous>:693:35)
voidtriangle commented 2 years ago

Workaround to close the window.

  1. Navigate: \.obsidian\plugins\obsidian-orthography
  2. Find file name "main.js"
  3. Comment Line or Remove following lines onPopupClose () function

    if (self.activeEditor) self.activeEditor.doc.getAllMarks().forEach((m) => m.clear());

commet

YIRU69 commented 2 years ago

@voidtriangle Thanks for you advise. I will test it.

denisoed commented 5 months ago

Fixed