neowit/vim-force.com — pull request #15 by nwallace (2013-09-25 14:15:01+00:00)
Title: Floats for API version

In my installation of this plugin, I had an issue with creating new files. The associated XML metadata file would not include the line with the ``. This would prevent me from deploying the new file until I manually edited the XML file to add the API version information. The cause of this problem I had was that in my `.vimrc`, I included this line:

```vimscript
let g:apex_API_version=28.0
```

As you know, this is incorrect, because the plugin assumes `g:apex_API_version` to be a string (`let g:apex_API_version='28.0'`). However, the documentation is a bit misleading in this regard, since the example value is not in quotes (doc/force.com.txt line 448):

```
|'g:apex_API_version'| force.com API version to use when create new files, ex: 25.0
```

Therefore, I think it makes sense to support both floats and strings for the value of `g:apex_API_version`.

The built-in `string()` function inserts quotes around string values (so `let val='28.0'; string(val)` returns `'28.0'`), so I use a custom function that switches on that special case to prevent the erroneous quotes going into the XML file.