Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Fixes #10152: Fix broken plugin API: editor.execCommand #10153

Merged

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Mar 18, 2024

Summary

Fixes and adds tests for the Joplin 'editor.execCommand' command. This fixes two issues related to the command:

  1. The editor command being executed with editor.execCommand was incorrectly extracted from the arguments list.
  2. The value of this was incorrect for legacy CM5 commands executed with editor.execCommand.

Fixes #10153.

Notes

This does not completely fix the "scroll to heading" logic in the outline plugin -- it uses a legacy CM5 API to scroll to the line containing a header that isn't supported on mobile (because of how we handle scroll to work around this bug). It does, however, allow similar commands to run.

Testing

  1. Install the outline plugin
  2. Open a note with headings
  3. Open the outline plugin's panel
  4. Click on a heading
  5. Verify that no error is logged (even if the heading isn't scrolled to)
  6. Add a breakpoint and verify that the command is run
    • This can be done by opening the note editor with Chrome's dev tools (chrome://inspect).

This has been tested successfully on Android 12.

@laurent22 laurent22 merged commit 44e8950 into laurent22:dev Mar 20, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants