Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/file-header.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ module.exports = FileHeader =
# the corresponding header template is presented
hasHeader: (editor, buffer, headerTemplate) ->
# these placeholder preambles are used as anchor points in source code scanning
if !(preambles = headerTemplate.match(/@[^:]+:/g))
if !(preambles = headerTemplate.match(/[@-#;\*\\][^:]+:/g))
return false
preambles = preambles.map(@escapeRegExp)
re = new RegExp(preambles.join('|'), if atom.config.get('file-header.ignoreCaseInTemplateField', scope: (do editor.getRootScopeDescriptor)) then 'gi' else 'g')
Expand All @@ -276,7 +276,7 @@ module.exports = FileHeader =

updateField: (editor, placeholder, headerTemplate, buffer, newValue) ->
escaptedPlaceholder = @escapeRegExp(placeholder)
re = new RegExp(".*(@[^:]+:).*#{ escaptedPlaceholder }.*(?:\r\n|\r|\n)", 'g')
re = new RegExp(".*([@-#;\*\\][^:]+:).*#{ escaptedPlaceholder }.*(?:\r\n|\r|\n)", 'g')
# find anchor point and line in current template
while match = re.exec(headerTemplate)
anchor = match[1]
Expand Down