Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

g:minisnip_finalstartdelim conflicts with Go templates #45

Open
arp242 opened this issue Jul 29, 2019 · 8 comments
Open

g:minisnip_finalstartdelim conflicts with Go templates #45

arp242 opened this issue Jul 29, 2019 · 8 comments

Comments

@arp242
Copy link

arp242 commented Jul 29, 2019

The syntax for Go templates is:

{{.Variable}}

You can control leading and trailing whitespace by adding -:

{{- .Variable}}
{{.Variable -}}
{{- .Variable -}}

That last variant conflicts with minisnip's g:minisnip_finalstartdelim, which is rather annoying.

I know this variable can be changed, but it seems to me that using a better default would be, well, better. Something like {{|- should be much more unique.

On the other hand, changing this would break compatibility for people with existing templates :-/

Not sure what the best course of action it. Either way, I thought I'd report it here.

@sigzero
Copy link

sigzero commented Aug 2, 2019

I would not be in favor of this change. The variable can be changed if you don't like it and a "better default" is highly subjective.

@arp242
Copy link
Author

arp242 commented Aug 3, 2019

It's not about "liking", it's about conflicting with a reasonably common language. That's not a "highly subjective" matter, and I would argue that anything that doesn't conflict with anything common is objectively better as a simple pragmatical matter.

@sigzero
Copy link

sigzero commented Aug 5, 2019

You can change them to not conflict so no change to minisnip is needed. It is about liking.

@arp242
Copy link
Author

arp242 commented Aug 5, 2019

Yes, I am aware. But then everyone writing Go templates will run in to this problem (which is rather confusing) and then have to change it. A default that no one has to change is better. The biggest issue is one of backwards compatibility, and whether it's worth the change.

@sigzero
Copy link

sigzero commented Aug 5, 2019

And when another language comes out with a template that uses whatever minisnip changes its default to then the discussion happens all over again. If I could vote, it would be no. It works for everyone now and allows the default to change when it needs to do so.

@sigzero
Copy link

sigzero commented Aug 5, 2019

Just as a note, not sure Joe is updating minisnip these days but I could be wrong.

@arp242
Copy link
Author

arp242 commented Aug 5, 2019

There are choices that are much less likely to conflict with anything. {{|-, {{||--, or something else.

Just as a note, not sure Joe is updating minisnip these days but I could be wrong.

Yeah, I don't know either. I wanted to document the issue in either case, even if no action is taken.

@joereynolds
Copy link
Owner

Just as a note, not sure Joe is updating minisnip these days but I could be wrong.

Not recently, I'm busy with other projects at the moment and it conflicted in some ways with coc.nvim so I stopped using it. I'm not sure if that's still the case though.

I do intend to get back on it one day, but I have other things going on at the moment, I appreciate the enthusiasm though! :D

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

No branches or pull requests

3 participants