Jürgen Krämer wrote:
Hi,

Yakov Lerner wrote:
How can a script test for specific patchlevel ?
For example, I have vim 7.0.86 and I need to check in the script that
patchlevel is >= 7.0.86. But v:version is 700. How ? It would be
nice if to have patchlist available through some v: variable.

you can check for a specific patch with

  :let patch_ok = has('patch123')

See

  :help has()
  :help feature-list

Regards,
Jürgen


Actually, for completeness you should test both version & patchlevel:

  if (version = 700 && has("patch86")) || version > 700

This will test FALSE with any prior version even if it has the 86th patch for that version; and when you upgrade to 7.1 it will still test TRUE.

Note that it is possible for patch 86 to be omitted even if patch 87 is present.

See ":help has-patch".


Best regards,
Tony.

Reply via email to