rodjek / vim-puppet

Puppet niceties for your Vim setup
Apache License 2.0
500 stars 137 forks source link

WIP: File include + fix format breaking up of long lines #114

Open lelutin opened 4 years ago

lelutin commented 4 years ago

This patchset is based off of #113

I've been trying to fix an annoying bug that affects users with textwidth set: when reaching the point where a line is long enough, puppet#format#Format gets called and the underlying command that's currently used flips the two last characters. I've detailed why this is happening in a comment in auto/puppet/format.vim. I've so far tried a couple different approaches to fix this up and none worked. I'm wondering if we'd be better off here deciding to disable this line-breaking function for the "i" and "R" modes so that lines don't get broken up as you type but would rather require users to use the gq command to format long lines correctly. I'm wondering if others have better ideas about this bug though.

The other thing in this patchset that I've tried to do and mostly accomplished is to setup include and includeexpr so that users can go on jumping from all references to another class/defined type to the actual file defining it. I've hit a roadblock while implementing this though: say that you have a line that reads contain ganeti::config, when typing the gf command while the cursor is on the word "ganeti", vim doesn't consider the whole class name and jumps to the file "init.pp" unexpectedly. a simliar thing happens if you have more than one part to the class name. for example if you had include apache::vhost::php, typing gf while the cursor is on "php" would try to find the file php.pp instead of vhost/php.pp. I'm not sure why the includeexpr is not getting more than one part of the class name.