I was debugging a problem with a plugin running on Vim73 on Arch Linux, and it seems to be due to an error in evaluating string expressions.
In this installation of Vim, the expression 'xxx' > ''evaluates to 0 (false), and in all the other Vims I've seen, the expression evaluates (as it should) to 1 (true).
Does anyone know an explanation for this? Arch Linux Vim has not been compiled with many built-in functions, but can there be any feature that changes the evaluation of string expressions?
Is there any Vim parameter (encoding?) That could change the result of string comparison? It was a simple installation of Vim (nothing remarkable in vimrc), giving a bad result, did not see that the parameter could be changed, even if there are some settings that affect this result.
Thanks for any info.
UPDATE:
It turns out that this problem was caused by an error in the string comparison function in the latest version of 64-bit Vim when the Vim ignorecase flag was set. A non-empty string should be larger than the empty string, regardless of whether the case was ignored, but Vim returned false. The bug report is here:
http://groups.google.com/group/vim_dev/browse_thread/thread/313bc7c46a19cd40
Workarounds would be: (1) use a comparison operator that forcibly compares the comparison, for example, mystring_var ># ''or (2) use !empty(mystring_var).
source
share