chrisbra / matchit

The matchit plugin from Vim
61 stars 9 forks source link

enforce less ambiguous syntax for concatenation operator #26

Closed lacygoill closed 3 years ago

lacygoill commented 3 years ago

A single dot is ambiguous: it can be the concatenation operator or the "access to dictionary member" token. Using two dots for the concatenation operator would help (if only when reading the code). It seems the plugin mostly uses . for the concatenation operators. But the style is inconsistent. Sometimes, there are spaces around it; sometimes not.

I suggest to use .. for a concatenation (to remove any ambiguity), and to always add spaces around. This way, the code would be more consistent, easier to read (because no ambiguity), and easier to refactor in Vim9 in the future (because those rules are enforced there).

We can't enforce the spaces around .., but we can enforce .. instead of . using the :scriptversion 4 directive.

chrisbra commented 3 years ago

let's merge it, I think in general it is a recommended way to remove ambiguity.