Closed sappjw closed 9 years ago
That's strange. uniq
should be a built-in function in vim. What happens if you do :echo uniq([1,1,2,3])
inside vim? The output should be [1,2,3]
. Is your vim compiled without the no-eval-features
?
:version
shows +eval
. The output of the echo is:
E117: Unknown function: uniq E15: Invalid expression: uniq([1, 1, 2, 3])
Strange! What is the content of your help files regarding the uniq function? :help :sort
should explain the sort command and point to the sort and uniq functions. :h uniq
should show the help for the uniq function.
I do not see an immediate alternative for the uniq function.
:h uniq
leads me to :map-<unique> E226 E227
. I can't find anything at (http://vimdoc.sf.net) about uniq()
either :frowning:.
It's listed at :help new-items-7
, so theoretically it should be available since 7.0.
In todo.txt
, there is the following note:
Patch to add sortuniq(). (Cade Forester, 2014 Mar 19) Or add uniq() instead? Patch by lcd47, but it has problems.
Perhaps Fedora is not at the right patch level. The latest message I see in the Changelog.rpm
is
Tue Aug 28 2012 Karsten Hopp <[e-mail address]> 7.3.638-1
- patchlevel 638
Which doesn't seem to match the "included patches" string from :version
, so maybe the Changelog is out of date. Also, I do not see anything matching the text uniq
in :help new-items-7
.
Ok, so I did a search in the source code, and it seems the uniq
function was introduced in vim version 7.4.218.
This leaves us with a choice; should we aim for support for older versions, or not? If not, then I could simply remove the uniq function call, which I think should typically not be necessary, or I could implement a simple uniq function for LaTeX-Box..
As far as I can tell, only the very latest versions of Ubuntu and Debian have an appropriate vim version. This means we stuck with a LTS/stable version would need to compile vim from the source to obtain uniq
. It would be nice to be able to used Latex-box without doing this...
Gentoo has >=7.4.273 available in stable.
I ran into the same problem with the default vim in the repository of the current Debian stable (wheezy, vim-7.3.547).
It would be more user-friendly if latex-box would not rely on Vim features of most recent patch levels.
At least noting in the README.md the targeted vim version would let user know what vim version they should have.
I made a pull request with a patch that I believe fixes this issue (at least for me it did).
9ddd65086820d96df1cef143 seems to have broken this plugin for me. I get the error below when compiling a LaTeX file that generates warnings:
This error goes away after reverting 9ddd65086820d96df1cef143.
Version info (current stable on Fedora 20):