aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/lua.txt
diff options
context:
space:
mode:
authorGianmaria Bajo <mg1979.git@gmail.com>2023-06-06 15:38:45 +0200
committerGitHub <noreply@github.com>2023-06-06 06:38:45 -0700
commitca887b80a911df4db4ab5f5496075b9415b9990a (patch)
tree6dbffbfc49528a9980b78ef0cd787ed359acdbb2 /runtime/doc/lua.txt
parentf5d12889e80d3369359b8248806694cf6d21f820 (diff)
downloadrneovim-ca887b80a911df4db4ab5f5496075b9415b9990a.tar.gz
rneovim-ca887b80a911df4db4ab5f5496075b9415b9990a.tar.bz2
rneovim-ca887b80a911df4db4ab5f5496075b9415b9990a.zip
fix: version-range < and <= #23539
vim.version.range() couldn't parse them correctly. For example, vim.version.range('<0.9.0'):has('0.9.0') returned `true`. fix: range:has() accepts vim.version() So that it's possible to compare a range with: vim.version.range(spec):has(vim.version())
Diffstat (limited to 'runtime/doc/lua.txt')
-rw-r--r--runtime/doc/lua.txt10
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/doc/lua.txt b/runtime/doc/lua.txt
index 54527c5a50..38289dc5d0 100644
--- a/runtime/doc/lua.txt
+++ b/runtime/doc/lua.txt
@@ -2832,11 +2832,15 @@ range({spec}) *vim.version.range()*
}
<
- `:has()` checks if a version is in the range (inclusive `from` , exclusive `to` ). Example: >lua
+ `:has()` checks if a version is in the range (inclusive `from`, exclusive
+ `to`).
+
+ Example: >lua
local r = vim.version.range('1.0.0 - 2.0.0')
- print(r:has('1.9.9')) -- true
- print(r:has('2.0.0')) -- false
+ print(r:has('1.9.9')) -- true
+ print(r:has('2.0.0')) -- false
+ print(r:has(vim.version())) -- check against current Nvim version
<
Or use cmp(), eq(), lt(), and gt() to compare `.to` and `.from` directly: >lua