Closed eng618 closed 6 years ago
Can you try with latest version of Atom
?
since the last version, you published yesterday, i can't save a file. when i disable "file-header" saving a file is no problem.
@guiguan I'm on 1.22.0-beta0
Strange. I am on 1.22.0-beta0
, and it works fine. Does this behaviour happen for new file as well?
I'm on 1.21.0 and my file failed to save. Upon updating to 1.22.0-beta0, it still doesn't save. When manually pressing the "Update Header" button, this error pops up: "Uncaught TypeError: Cannot read property 'undoStack' of undefined"
@guiguan yes, same behaviour with new files... On first creation of new file there are 2 headers and add a new one with each save
@TheCool1Kevin try #49
@ENG618 what kind of files were you working on? js
? Can you share a snippet and let me see if I can recreate the problem on my end?
@naiz0 try #49
works now for linux and windows. thanks!
yes .js files and you can do or .sh are the only ones I have tested on. You can use any new or existing file and it should exhibit the same behavior.
The enable auto update, is the only checkbox causing the issue. It applies okay on new files and works fine if that update one is not checked.
I also do have custom header templates that are being used...not sure if that might have something to do with it at all since possible the default template is not being present in the update check and then adds a new header.
@ENG618 Custom header should work fine. I am using mine as well. I couldn't reproduce your error on my Atom.
Do you have those @
in your custom header templates?
@guiguan no there are no @
in my template...it's just plain text.
C.tmpl looks like this:
/**
* Licensed Materials - Property of Example
*
* (C) Copyright Example Corporation 2017
*
* Other text here
*/
Just tested with:
/**
* @Licensed Materials - Property of Example
*
* @(C) Copyright Example Corporation 2017
*
* @Other text here
*/
and
/**
* @Licensed Materials - Property of Example
* @
* @(C) Copyright Example Corporation 2017
* @
* @Other text here
*/
same result
If I'm not using custom templates, it seems to work fine and only add it once...
@ENG618 I see your problem now. file-header
needs two @
for the auto-update's regex to work: https://github.com/guiguan/file-header/blob/master/lib/file-header.coffee#L279. So in your case, you need to keep at least two @
for {{last_modified_by}}
and {{last_modified_time}}
:
* @Last author: {{last_modified_by}}
* @Last timestamp: {{last_modified_time}}
Closing this problem now. @ENG618 let me know if you are still suffering from this
Unfortunately I am suffering from the same issue. I do too have a custom template that does NOT use @.
would be nice if I didn't have to have those @
in there. You could simply check against the template to see if those chars match what is in there.
PR #44 seemed to take a step in the right direction...but now when I "enable auto update" it adds subsequent headers with each save.
i.e. if I save a file 3 times it adds 3 headers.