Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow update of header without '@' #53

Open
mjmaix opened this issue Feb 27, 2018 · 4 comments
Open

[Feature Request] Allow update of header without '@' #53

mjmaix opened this issue Feb 27, 2018 · 4 comments

Comments

@mjmaix
Copy link

mjmaix commented Feb 27, 2018

From #52

Cannot make this template work since it does not have '@' on the lines

/* # ---------------------------------------------
# ---------------------------------------------
# Author: {{author}}
# Date:   {{create_time}}
# Last Modified by: {{last_modified_by}}
# Last Modified time: {{last_modified_time}}
# ---------------------------------------------
# --------------------------------------------- */

Thank you.

@nasyxx
Copy link

nasyxx commented May 3, 2018

So, there I said why it does not automatically update.

@julian-poidevin
Copy link

It also doesn't work with '\' on the lines :

/**
 * \file    base_fpga_config.h
 * \brief   configuration file
 */

When using this kind of template, the header keeps being included on save :
ezgif com-video-to-gif

nasyxx added a commit to nasyxx/file-header that referenced this issue Aug 2, 2018
Add feature: allow update of the header with not only  "@" but also other char.

- `#` for languages like Python
- `*` for languages like C
- `-` for languages like Haskell
- `;` for languages like lisp

Thought it works well on my Mac, I am still not sure whether it would cause any problem or not.
@nasyxx
Copy link

nasyxx commented Aug 2, 2018

Hi, I changed here and worked.

if !(preambles = headerTemplate.match(/@[^:]+:/g))

re = new RegExp(".*(@[^:]+:).*#{ escaptedPlaceholder }.*(?:\r\n|\r|\n)", 'g')

@julian-poidevin In addition to what I changed here, you still need to add :, or change [^:]+: in the source code to .+. But I am still not sure, due to I am not very familiar with regex.

@julian-poidevin
Copy link

Hey! In fact I forked your repo yesterday and made this modification myself (see fdcc6e0).

Thanks for the hint. 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants