markerikson / joplin-plugin-vscode-style-search

A Joplin plugin that provides a search UI panel patterned after VS Code, with matches per note and per-match hit highlighting
20 stars 2 forks source link

Opening/closing the plugin loses most recent edits to the current note #6

Open Philipp91 opened 2 days ago

Philipp91 commented 2 days ago

Reproduction:

  1. Have some note open with some content.
  2. Edit that content and press Ctrl+Shift+F immediately.
  3. The search side bar opens (and works fine), but the recently made edits to the note are gone. I guess it loads some previously saved state.

Presumably the plugin should first trigger a save from the user-visible text box to Joplins internal storage before replacing the UI with the two-pane layout that allows displaying the side bar.

markerikson commented 2 days ago

I don't think there's anything I can do about that. All the plugin is doing is toggling the visibility of its webview panel. I don't have any control over what Joplin does beyond that:

https://github.com/markerikson/joplin-plugin-vscode-style-search/blob/00eaf5e4198ae7dfe5a87becb843c07d0a16c2a5/src/index.ts#L139-L149