vim-template
vim-template copied to clipboard
comments swallowed when expanding template
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.
@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.)
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.
@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 :wink:
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.
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.