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

How to change the default editor? #2

Open
niruvt opened this issue Jul 27, 2021 · 6 comments
Open

How to change the default editor? #2

niruvt opened this issue Jul 27, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@niruvt
Copy link

niruvt commented Jul 27, 2021

I am having a problem with the ACE editor because of its handling of diacritics. It doesn't do it properly. If you want to test, you can try हा मजकूर देवनागरी लिपीत स्वरांशचिन्हांसह लिहिण्यात आला आहे. in any of the ACE window. This is not just the case with Devanagari script, it will happen with IPA too. e.g. Try t̪ t̪ʰə d̪ə d̪ʱə n̪ə. ACE developers are probably working on it, but it seems like this issue has been reported almost ten years ago (see: ajaxorg/ace#460) to them, but there is no concrete development till now. On that thread I found this version which works fine, but probably it isn't released yet. https://brionv.com/misc/demo/ace/build/kitchen-sink.html

OTOH I tried https://codemirror.net/ which is also an MIT licensed editor. It handles both of the above examples exactly as expected. For my needs it suits perfect. LaTeX needs to handle multiple scripts. I would appreciate if you can change the default editor to codemirror. If this is not a possibility; you can provide a switch to change the editor, it would also be pretty amazing!

Thanks 😄

@davidcarlisle
Copy link
Owner

davidcarlisle commented Aug 8, 2021

Thanks for the report, I have looked in to this a bit and it seems getting a fixed ACE may be problematic,

Using codemirror must be possible in principle (also do you know if monaco https://microsoft.github.io/monaco-editor/ is OK ?)

But currently the ACE API is used all over for setting up the page and extracting the currently edited text when you click the submit button.

So it will take a bit of time to work out (a) how to make another editor work at all and (b) think about how best to parameterise things so that you can switch editor without breaking all the current configuration points.

As far as I can see Overleaf (which also uses ACE) has the same issue?

@davidcarlisle davidcarlisle self-assigned this Aug 8, 2021
@davidcarlisle davidcarlisle added the enhancement New feature or request label Aug 8, 2021
@niruvt
Copy link
Author

niruvt commented Aug 9, 2021

Using codemirror must be possible in principle (also do you know if monaco https://microsoft.github.io/monaco-editor/ is OK?)

Monaco editor also seems to be good, but it says the following on it's homepage.

The Monaco editor is not supported in mobile browsers or mobile web frameworks.

So this might be a problem.

So it will take a bit of time to work out (a) how to make another editor work at all and (b) think about how best to parameterise things so that you can switch editor without breaking all the current configuration points.

I agree. There is no need to hurry, take your time.

As far as I can see Overleaf (which also uses ACE) has the same issue?

Yes, I couldn't use Overleaf for my MA thesis because of this reason 😞

@davidcarlisle
Copy link
Owner

davidcarlisle commented Aug 30, 2021

@niruvt can you try

https://davidcarlisle.github.io/latexcgi/test-codemirror

I put your Marathi phrase in one of the examples at this page.

Currently this is implemented as a separate runlatex-codemirror.js script but that is temporary it should be possible to merge this back in to runlatex.js and make the editor an option, but can you see if it does what you expect?

@niruvt
Copy link
Author

niruvt commented Aug 31, 2021

Yes, it does what I want 😄

Thanks

@niruvt
Copy link
Author

niruvt commented Oct 9, 2021

Any updates on this?

@davidcarlisle
Copy link
Owner

I had it working in codemirror5 but was trying to get it working for codemirror6 the new version (oficially in test release) but that seemed harder to set up and I ran out of time. I a trying to structure runlatex.js so it can work with any editor that provides a minimal shared interface so I may go with ace and cm5 initially and then look to add cm6 support later as I don't think I have any time to sort out cm6 at present. Sorry it's taking a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants