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

Error in mode-latex getType #5090

Closed
kurtslagle opened this issue Mar 10, 2023 · 3 comments
Closed

Error in mode-latex getType #5090

kurtslagle opened this issue Mar 10, 2023 · 3 comments

Comments

@kurtslagle
Copy link

When using mode-latex, a console error appears saying Cannot read properties of null (reading 'type'), coming from https://github.com/ajaxorg/ace-builds/blob/master/src-noconflict/mode-latex.js#L142

It seems like whenever there isn't any content after the cursor, typing \begin or \end to begin or end a new environment causes a console error to show up.

It's simple to reproduce in the kitchen sink: https://ajaxorg.github.io/ace-builds/kitchen-sink.html
Just set the mode to LaTeX and with this document content

\usepackage{amsmath}
\title{\LaTeX}
\date{}
<start typing here>

begin typing \begin{document}. Once you finish typing begin, the console error will show up.

This doesn't appear to happen if there is any text after where you would be typing \begin{..., like this

<start typing here>
some other stuff

typing \begin does not make the error appear.

@InspiredGuy
Copy link
Contributor

This repository only contains generated files. I will transfer this issue to https://github.com/ajaxorg/ace, as it seems to be relevant to latex mode implementation.

@InspiredGuy InspiredGuy transferred this issue from ajaxorg/ace-builds Mar 15, 2023
InspiredGuy pushed a commit that referenced this issue Mar 16, 2023
* fix bug with missing token

* add test for latex folding

Issue #5090
@andrewnester
Copy link
Contributor

Released in 1.16.0

@kurtslagle
Copy link
Author

Thank you for fixing that so quickly!

akoreman pushed a commit to akoreman/ace that referenced this issue Mar 19, 2023
* fix bug with missing token

* add test for latex folding

Issue ajaxorg#5090
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants