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

Add cm-chs-patch and table-extended #229

Closed
wants to merge 3 commits into from
Closed

Conversation

aidenlx
Copy link
Contributor

@aidenlx aidenlx commented Apr 2, 2021

[x] I am submitting a new Community Theme

Repo URL

Release Checklist

  • I have tested this on Windows, macOS
  • Github release contains all required files
    • main.js
    • manifest.json
    • styles.css (optional)
  • Github release name matches the exact version number specified in your manifest.json (Note: Use the exact version number, don't include a prefix v)
  • The id in my manifest.json matches the id in the community-plugins.json file.
  • README clearly describes the plugins purpose and provides clear usage instructions.

Related Feature Request: https://forum.obsidian.md/t/editor-cm5-doesnt-support-word-splitting-in-cjk-languages/15773

@aidenlx aidenlx changed the title Add cm-chs-patch Add cm-chs-patch and table-extended Apr 3, 2021
@lishid
Copy link
Collaborator

@lishid lishid commented Apr 5, 2021

I'd suggest splitting your two unrelated plugins so that they can be reviewed and/or merged separately :)

Also please consider auto-formatting your code so they appear nicer when read from github.

https://github.com/alx-plugins/table-extended/blob/e830b0f04912ca0eecba60b25fa8ef458809f47b/src/main.ts#L42
That's pretty obscure, and also .obsidian is now configurable so this will definitely break. Use the undocumented API Vault.getConfig instead. It's still undocumented, but at least it won't break for now.

https://github.com/alx-plugins/table-extended/blob/e830b0f04912ca0eecba60b25fa8ef458809f47b/src/main.ts#L70
I don't think it's a good idea to work with unsanitary HTML - consider moving the DOM elements over directly?

@lishid
Copy link
Collaborator

@lishid lishid commented Apr 5, 2021

https://github.com/alx-plugins/cm-chs-patch/blob/6e7af09145d9a5709702de0747eb9c7440a98884/src/main.ts#L21
Here you can use Workspace.iterateCodeMirrors to restore the default findWordAt behavior.

https://github.com/alx-plugins/cm-chs-patch/blob/6e7af09145d9a5709702de0747eb9c7440a98884/src/inject.js#L78
Here you are relying on window.app which is only there for debugging purposes and may not be always available.
I'd suggest you just pass in segmentit, or make the entire findWordAt function bound to your plugin.

@aidenlx
Copy link
Contributor Author

@aidenlx aidenlx commented Apr 6, 2021

OK, I'll close this pull request and file new ones separately.

@aidenlx aidenlx closed this Apr 6, 2021
@aidenlx aidenlx deleted the patch-1 branch Apr 6, 2021
@aidenlx aidenlx mentioned this pull request Apr 6, 2021
7 tasks
@aidenlx aidenlx mentioned this pull request Apr 6, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants