Open Lessica opened 3 years ago
Thank you for the feedback. I update the JavaScript syntax style definition to solve this issue. The change will be shipped with the next version.
I believe this fix caused new issues when using forward slash as dividing operator or when using two forward slashes to comment. See included screenshots.
Thank you for the report and sorry for the enbug. I close this issue just because it is the same as issue #1187. I'll fix it anyway in the next version.
Regrettably, I need to say I reopen this issue because the JavaScript syntax highlight definition will be restored in the next version to solve the further issue, which was reported by @JJHackimoto and in #1187.
I understand the current issue on the regex literal in CotEditor's JavaScript definition. However, by studying the source code, I realize this is the limit of the current syntax highlight mechanism in CotEditor, which is simple but originally designed aiming that users can modify it easily in GUI.
To solve this issue, I need to redesign CotEditor's syntax highlight system and definition format drastically. In other words, it takes time.
Sorry for that. I actually know for years I need to update this highlighting system and put in my to-do list, but not decided yet when I'll set about this task.
Regular expression literal are not properly rendered. If quotes
"
are included in a regex literal, all syntax highlights after that will fail.Creating a regular expression
You construct a regular expression in one of two ways:
Regular expression literals provide compilation of the regular expression when the script is loaded. If the regular expression remains constant, using this can improve performance.
RegExp
object, as follows:Using the constructor function provides runtime compilation of the regular expression. Use the constructor function when you know the regular expression pattern will be changing, or you don't know the pattern and are getting it from another source, such as user input.
Referenced from: Regular expressions - JavaScript | MDN