ryanmcalister / unotes

Unotes Visual Studio Code Extension. A markdown WYSIWYG notes editor.
MIT License
173 stars 22 forks source link

UNotes visual editor often loses focus #144

Closed epikgit closed 1 year ago

epikgit commented 1 year ago

Hello Ryan, Thank you for your work. I've just seen your commits for the 1.5 and I can't wait to test the new version.

I'm opening this issue because of the loss of focus. This problem is starting to become really annoying for people like me that use UNotes extensively. The focus goes lost after any window change (ALT+TAB, switch with a taskbar button) and there is no way to put it back in the WYSIWYG editor other than using the f***ing mouse. Sometimes, after a change, I see the caret blinking once and then disappearing. Maybe is the issue tied with the auto save feature? Because I imagine that when the window re-take the focus it saves the document and probably the saving is responsible for the loss of focus.

If solving the issue is too difficult, is it possible to implement a shortcut to reset the focus on the document? Possibly on the last known caret position. You've already set a lot of shortcuts and I tested all of them. For example unotes.openWith opens the current document from file explorer in UNotes but doesn't put the focus in it...). The shortcut unotes.toggleMode is the more promising. It opens the MD editor and puts the focus in it but if you toggle the editor again you have finally the focus on the WYSIWYG editor. It works but it is a bit cumberstone.

My setup:

Thank you

ryanmcalister commented 1 year ago

Thanks for the suggestion. In v1.5.0 I added a focus hotkey and also a new setting unotes.editor.extraFocus to help with this issue. Hope that helps.

epikgit commented 1 year ago

Dear Ryan, I've just updated UNotes to 1.5.0 and the autofocus feature is working perfectly. Even if the focus goes lost in some rare and unpredictable situations, the new hotkey is decisive. Thank you.