V5.6β : Behavior of inkdrop.onEditorLoad changed?

Behavior of inkdrop.onEditorLoad Changed ?

const plugin = new MyPlugin();
module.exports = {
  activate() {
    plugin.activate();
  },
  deactivate() {
    plugin.deactivate();
  },
};

MyPlugin

export class MyPlugin {
  activate() {
    inkdrop.onEditorLoad((_) => {
      // ・・・
    });
  }
}

In this code snippet, the function inside inkdrop.onEditorLoad used to execute in previous versions, but it doesn’t execute in version 5.6β.

Is it assumed that the editor is already loaded when the plugin is loaded?
If it’s uncertain whether the editor is loaded or not, is there a way to determine that?

In the case of init.js , inkdrop.onEditorLoad was executed.

This is probably because plugins are now loaded asynchronously. You can run inkdrop.isEditorActive() to check if the editor is already loaded.

1 Like

@Lukas is right.
You can make sure the editor is already loaded by checking inkdrop.getActiveEditor().

@Lukas @craftzdog

Thanks !