Skip to content

Commit

Permalink
优化注释TODO高亮
Browse files Browse the repository at this point in the history
  • Loading branch information
javamxd committed Aug 8, 2021
1 parent 41512af commit 3155671
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions magic-editor/src/console/src/scripts/editor/high-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,16 @@ export const HighLightOptions = {
[/`/, 'string', '@string_backtick']
],
comment: [
[/((TODO)|(todo)|(fixme)|(FIXME))[ \t]+[^\n(?!\*\/)]+/, 'comment.todo'],
[/[ \t]+/, 'comment'],
[/\*\//, 'comment', '@pop'],
[/[^ \t*\/]+(?!((TODO)|(todo)|(fixme)|(FIXME)))/, 'comment'],
[/./, 'comment'],
[/\*\//, 'comment', '@popall'],
[/\S((TODO)|(todo)|(fixme)|(FIXME))\s+/, 'comment'],
[/((TODO)|(todo)|(fixme)|(FIXME))\s+[^(*/)]+/, 'comment.todo'],
[/\S/, 'comment'],
],
commentTodo: [
[/((TODO)|(todo)|(fixme)|(FIXME))[ \t]+[^\n]+/, 'comment.todo','@popall'],
[/^/,'', '@popall'],
[/[^ \t]+(?!((TODO)|(todo)|(fixme)|(FIXME)))/, 'comment', '@commentTodo']

[/\S((TODO)|(todo)|(fixme)|(FIXME))\s+/, 'comment'],
[/((TODO)|(todo)|(fixme)|(FIXME))[ \t]+[^\n]+/, 'comment.todo','@popall'],
[/\S/, 'comment'],
],
regexp: [
[
Expand Down

0 comments on commit 3155671

Please sign in to comment.