| Summary: | Script error loading a file with text mate styles | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Chris McGee <cbmcgee> |
| Component: | Editor | Assignee: | Grant Gayed <grant_gayed> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | ken_walker, simon_kaegi |
| Version: | 5.0 | ||
| Target Milestone: | 5.0 M2 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
Thanks for looking into this, the simple fix is fine. Fixed > 20140126, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2b8cc21d5db7220bd296af9af5fd47728f2f9258 . |
When opening a file that uses the text mate styler for syntax highlighting I get an error immediately on page load. No editor contents are shown. I traced the problem to the getStyleAccessor() method in editorView.js: getStyleAccessor: function() { var styleAccessor = null; var styler = this.syntaxHighlighter.getStyler(); if (styler) { styleAccessor = styler.getStyleAccessor(); /* ERROR, there is no getStyleAccessor() on the text mate styler object */ } return styleAccessor; } A simple workaround is to change the method to this: getStyleAccessor: function() { var styleAccessor = null; var styler = this.syntaxHighlighter.getStyler(); if (styler && styler.getStyleAccessor) { styleAccessor = styler.getStyleAccessor(); } return styleAccessor; }