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

Configure octave syntax highlight support as MATLAB (.m) files. #2228

Closed
evandrocoan opened this issue Nov 5, 2014 · 8 comments
Closed

Configure octave syntax highlight support as MATLAB (.m) files. #2228

evandrocoan opened this issue Nov 5, 2014 · 8 comments

Comments

@evandrocoan
Copy link

Octave and MATLAB files use the same syntax highlight, but the editor does not know that.
Could we teach him?

@evandrocoan
Copy link
Author

Sorry, i forgot to say that the MATLAB syntax highlight is already supported.
Then what remains is just set (.m) files to use the MATLAB highlight.

@evandrocoan
Copy link
Author

And i too noticed that, the (.m) files are setted to Objective-C syntax highlight.
So, what happens is that Objective-C, MATLAB and Octave use the same file extension (.m), but only MATLAB and Octave share the same syntax highlight.
In the end, remains to add a feature to the editor to associate/exchange the default syntax highlight to a selected file extension (like our .m files).

@nightwing
Copy link
Member

Normally that would require only adding it to https://github.com/ajaxorg/ace/blob/master/lib/ace/ext/modelist.js#L117, but m extension is already taken by ObjectiveC mode, so we need some way to detect language based on file contents. #849
But where do you Ace? Normally IDEs have a way to switch the mode manually.

@evandrocoan
Copy link
Author

Thanks nightwing, I code at cloud9, it's supports that i change manually the syntax highlights, but its annouying.

@nightwing
Copy link
Member

Ah, i see. It also needs a way to manually change default mode for all files, not just one.

@evandrocoan
Copy link
Author

It's what i should say since the beginning.
Thanks nightwing.

@nightwing
Copy link
Member

Until the ui is added, you can run the following code snippet in the browser console.

var settingPlugin = apf.getPlugin("settings"); 
types = settingPlugin.getJson("user/ace/custom-types"); 
types["m"] = "matlab";
settingPlugin.setJson("user/ace/custom-types", types)

merging this issue into #849

@evandrocoan
Copy link
Author

Thank you, nightwing :)

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

No branches or pull requests

2 participants