pdv icon indicating copy to clipboard operation
pdv copied to clipboard

Half broken output

Open k1sul1 opened this issue 7 years ago • 2 comments

Consider the following function:

function get_acf_option($option = '', $location = 'options', $format = true) {

When I use pdv#DocumentCurrentLine() on it, I get the following output:

/**
 * ${1:get_acf_option}
 *
 * @param ${2:string} $option${3}
 * @param ${4:string} $location${5}
 * @param ${6:mixed} $format${7}
 */
function get_acf_option($option = '', $location = 'options', $format = true) {

I'm using Vundle to manage my plugins, and I've installed both vmustache & pdv:

let g:pdv_template_dir = $HOME ."/.vim/bundle/pdv/templates_snip"

Plugin 'tobyS/vmustache'
Plugin 'tobyS/pdv'

map <F6> :call pdv#DocumentCurrentLine()<CR>

While the current output is definitely better than manually typing all that, I have to quite a bit of cleanup afterwards. Am I doing something wrong perhaps?

k1sul1 avatar May 02 '17 13:05 k1sul1

I know this is an old issue, but to avoid this, the problem is that you are probably using templates_snip instead of templates. The templates_snip templates are vmustache templated for use with UltiSnips.

The readme is not super clear on this so it took me a while to figure out as well. I'm sure you found the solution or a workaround by now but this is just for anyone else's benefit who ends up here.

kevinquinnyo avatar Dec 30 '17 20:12 kevinquinnyo

Yeah, I did eventually end up using UltiSnips. I just had some problems with it when I first started using Vim, so I did't want to use it at first, and this issue was born.

k1sul1 avatar Dec 31 '17 10:12 k1sul1