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

comments swallowed when expanding template #115

Open
Konfekt opened this issue Mar 26, 2017 · 5 comments
Open

comments swallowed when expanding template #115

Konfekt opened this issue Mar 26, 2017 · 5 comments
Labels

Comments

@Konfekt
Copy link

Konfekt commented Mar 26, 2017

The file template=makefile with content

NAME=main
FILES=%HERE%
DEP=$(NAME).pandoc $(FILES)

# vim:ft=make

produces, when calling vim makefile, the following file:

NAME=main
FILES=%HERE%
DEP=$(NAME).pandoc $(FILES)

That is, the comment disappears. In fact, if the comment is not placed at the beginning of the file, all lines below it won't appear when the template is expanded.

@aperezdc
Copy link
Owner

@Konfekt: Sorry, I cannot reproduce this using a local template, nor a global one. Are you setting any options for the plugin? If yes, which ones and to which values?

(As a gentle reminder, note that the default file names searched for local templates are .vim-template:<pattern>, and =template=<pattern> for global templates.)

@Konfekt
Copy link
Author

Konfekt commented Mar 29, 2017

Thank you. Indeed, the problem is naming the template =template=makefile.pandoc and calling vim makefile.pandoc with the plugin 'https://github.com/vim-pandoc/vim-pandoc' installed.

@aperezdc
Copy link
Owner

aperezdc commented Apr 6, 2017

@Konfekt: I am glad that it seems to be working for you now! I guess we can close this issue now. Anyway, if you run into trouble again, or open a new one if you run into any other issue. Bug reports from user are super-useful 😉

@aperezdc aperezdc closed this as completed Apr 6, 2017
@aperezdc
Copy link
Owner

aperezdc commented Apr 8, 2017

Reopening this, because adding a blank line to the template avoids the comment being swallowed (as per comment in vim-pandoc/vim-pandoc#218). We definitely have some issue with the logic around l:deleteLastLine at templates.vim:453.

@aperezdc aperezdc reopened this Apr 8, 2017
@aperezdc aperezdc added the bug label Apr 8, 2017
@aperezdc
Copy link
Owner

aperezdc commented Apr 8, 2017

I can try to figure a solution, but I am afraid it will take time as I'm quite busy lately. It would be awesome if @muff1nman could take a look at this, as he wrote some of the code around the last line deletion logic.

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

No branches or pull requests

2 participants