Skip to content

Commit

Permalink
Fix speed issue with Javascript plugin(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcenteno committed Mar 24, 2017
1 parent 84295c0 commit 1faa829
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion syntax/pug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo,@Spell
syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo,@Spell keepend
syn region pugHtmlConditionalComment start="<!--\%(.*\)>" end="<!\%(.*\)-->" contains=pugCommentTodo,@Spell
syn region pugAngular2 start="(" end=")" contains=htmlEvent
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,pugAngular2,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
syn region pugJavascriptString start=+"+ skip=+\\\("\|$\)+ end=+"\|$+ contained
syn region pugJavascriptString start=+'+ skip=+\\\('\|$\)+ end=+'\|$+ contained
syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=pugJavascriptString,pugHtmlArg,pugAngular2,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent
syn match pugClassChar "\." containedin=htmlTagName nextgroup=pugClass
syn match pugBlockExpansionChar ":\s\+" contained nextgroup=pugTag,pugClassChar,pugIdChar
syn match pugIdChar "#[[{]\@!" contained nextgroup=pugId
Expand Down Expand Up @@ -99,6 +101,7 @@ hi def link pugCommentTodo Todo
hi def link pugComment Comment
hi def link pugCommentBlock Comment
hi def link pugHtmlConditionalComment pugComment
hi def link pugJavascriptString String

let b:current_syntax = "pug"

Expand Down

1 comment on commit 1faa829

@boringtu
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Emm..
Your modifications seem not working very well..
Before:
Before
After:
After

What do u think? :D @kevcenteno

Please sign in to comment.