mirror of
https://github.com/neovim/neovim.git
synced 2025-11-14 22:39:08 +00:00
Merge pull request #34668 from brianhuster/release-0.11
This commit is contained in:
@@ -5,7 +5,9 @@
|
|||||||
" Contributor: Dorai Sitaram <ds26@gte.com>
|
" Contributor: Dorai Sitaram <ds26@gte.com>
|
||||||
" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
|
" C.D. MacEachern <craig.daniel.maceachern@gmail.com>
|
||||||
" Phạm Bình An <phambinhanctb2004@gmail.com>
|
" Phạm Bình An <phambinhanctb2004@gmail.com>
|
||||||
" Last Change: 2025 Feb 27
|
" @konfekt
|
||||||
|
" Last Change: 2025 Apr 04
|
||||||
|
" 2025 May 06 by Vim Project update 'path' setting #17267
|
||||||
|
|
||||||
if exists("b:did_ftplugin")
|
if exists("b:did_ftplugin")
|
||||||
finish
|
finish
|
||||||
@@ -28,6 +30,7 @@ set cpo&vim
|
|||||||
setlocal comments=:---,:--
|
setlocal comments=:---,:--
|
||||||
setlocal commentstring=--\ %s
|
setlocal commentstring=--\ %s
|
||||||
setlocal formatoptions-=t formatoptions+=croql
|
setlocal formatoptions-=t formatoptions+=croql
|
||||||
|
setlocal path-=. " Lua doesn't support importing module in path related to current file like JS
|
||||||
|
|
||||||
let &l:define = '\<function\|\<local\%(\s\+function\)\='
|
let &l:define = '\<function\|\<local\%(\s\+function\)\='
|
||||||
|
|
||||||
@@ -35,7 +38,7 @@ let &l:include = '\<\%(\%(do\|load\)file\|require\)\s*('
|
|||||||
setlocal includeexpr=s:LuaInclude(v:fname)
|
setlocal includeexpr=s:LuaInclude(v:fname)
|
||||||
setlocal suffixesadd=.lua
|
setlocal suffixesadd=.lua
|
||||||
|
|
||||||
let b:undo_ftplugin = "setl cms< com< def< fo< inc< inex< sua<"
|
let b:undo_ftplugin = "setl cms< com< def< fo< inc< inex< sua< pa<"
|
||||||
|
|
||||||
if exists("loaded_matchit") && !exists("b:match_words")
|
if exists("loaded_matchit") && !exists("b:match_words")
|
||||||
let b:match_ignorecase = 0
|
let b:match_ignorecase = 0
|
||||||
|
|||||||
@@ -238,8 +238,8 @@ function VersionRange:has(version)
|
|||||||
version = setmetatable(vim.deepcopy(version, true), Version)
|
version = setmetatable(vim.deepcopy(version, true), Version)
|
||||||
end
|
end
|
||||||
if version then
|
if version then
|
||||||
if version.prerelease ~= self.from.prerelease then
|
if self.from == self.to then
|
||||||
return false
|
return version == self.from
|
||||||
end
|
end
|
||||||
return version >= self.from and (self.to == nil or version < self.to)
|
return version >= self.from and (self.to == nil or version < self.to)
|
||||||
end
|
end
|
||||||
@@ -310,9 +310,7 @@ function M.range(spec) -- Adapted from https://github.com/folke/lazy.nvim
|
|||||||
local from = semver --- @type vim.Version?
|
local from = semver --- @type vim.Version?
|
||||||
local to = vim.deepcopy(semver, true) --- @type vim.Version?
|
local to = vim.deepcopy(semver, true) --- @type vim.Version?
|
||||||
---@diagnostic disable: need-check-nil
|
---@diagnostic disable: need-check-nil
|
||||||
if mods == '' or mods == '=' then
|
if mods == '<' then
|
||||||
to.patch = to.patch + 1
|
|
||||||
elseif mods == '<' then
|
|
||||||
from = M._version({})
|
from = M._version({})
|
||||||
elseif mods == '<=' then
|
elseif mods == '<=' then
|
||||||
from = M._version({})
|
from = M._version({})
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ describe('version', function()
|
|||||||
|
|
||||||
describe('range', function()
|
describe('range', function()
|
||||||
local tests = {
|
local tests = {
|
||||||
['1.2.3'] = { from = { 1, 2, 3 }, to = { 1, 2, 4 } },
|
['1.2.3'] = { from = { 1, 2, 3 }, to = { 1, 2, 3 } },
|
||||||
['1.2'] = { from = { 1, 2, 0 }, to = { 1, 3, 0 } },
|
['1.2'] = { from = { 1, 2, 0 }, to = { 1, 3, 0 } },
|
||||||
['=1.2.3'] = { from = { 1, 2, 3 }, to = { 1, 2, 4 } },
|
['=1.2.3'] = { from = { 1, 2, 3 }, to = { 1, 2, 3 } },
|
||||||
['>1.2.3'] = { from = { 1, 2, 4 } },
|
['>1.2.3'] = { from = { 1, 2, 4 } },
|
||||||
['>=1.2.3'] = { from = { 1, 2, 3 } },
|
['>=1.2.3'] = { from = { 1, 2, 3 } },
|
||||||
['<1.2.3'] = { from = { 0, 0, 0 }, to = { 1, 2, 3 } },
|
['<1.2.3'] = { from = { 0, 0, 0 }, to = { 1, 2, 3 } },
|
||||||
@@ -100,17 +100,25 @@ describe('version', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('[to] not in range ' .. input .. ' to:' .. tostring(range.to), function()
|
it('[to] not in range ' .. input .. ' to:' .. tostring(range.to), function()
|
||||||
if range.to then
|
if range.to and range.to ~= range.from then
|
||||||
assert(not (range.to < range.to))
|
assert(not (range.to < range.to))
|
||||||
assert(not range:has(range.to))
|
assert(not range:has(range.to))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it('[to] in range ' .. input .. ' to:' .. tostring(range.to), function()
|
||||||
|
if range.to and range.to == range.from then
|
||||||
|
assert(range:has(range.to))
|
||||||
|
end
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
it('handles prerelease', function()
|
it('handles prerelease', function()
|
||||||
assert(not vim.version.range('1.2.3'):has('1.2.3-alpha'))
|
assert(not vim.version.range('1.2.3'):has('1.2.3-alpha'))
|
||||||
assert(vim.version.range('1.2.3-alpha'):has('1.2.3-alpha'))
|
assert(vim.version.range('1.2.3-alpha'):has('1.2.3-alpha'))
|
||||||
assert(not vim.version.range('1.2.3-alpha'):has('1.2.3-beta'))
|
assert(not vim.version.range('1.2.3-alpha'):has('1.2.3-beta'))
|
||||||
|
assert(vim.version.range('>0.10'):has('0.12.0-dev'))
|
||||||
|
assert(not vim.version.range('>=0.12'):has('0.12.0-dev'))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('returns nil with empty version', function()
|
it('returns nil with empty version', function()
|
||||||
@@ -138,6 +146,7 @@ describe('version', function()
|
|||||||
{ v1 = '1.0.0-2.0', v2 = '1.0.0-2', want = 1 },
|
{ v1 = '1.0.0-2.0', v2 = '1.0.0-2', want = 1 },
|
||||||
{ v1 = '1.0.0-2.0', v2 = '1.0.0-2.0', want = 0 },
|
{ v1 = '1.0.0-2.0', v2 = '1.0.0-2.0', want = 0 },
|
||||||
{ v1 = '1.0.0-alpha', v2 = '1.0.0-alpha', want = 0 },
|
{ v1 = '1.0.0-alpha', v2 = '1.0.0-alpha', want = 0 },
|
||||||
|
-- Per semver spec, prereleases have alphabetical ordering.
|
||||||
{ v1 = '1.0.0-alpha', v2 = '1.0.0-beta', want = -1 },
|
{ v1 = '1.0.0-alpha', v2 = '1.0.0-beta', want = -1 },
|
||||||
{ v1 = '1.0.0-beta', v2 = '1.0.0-alpha', want = 1 },
|
{ v1 = '1.0.0-beta', v2 = '1.0.0-alpha', want = 1 },
|
||||||
{ v1 = '1.0.0-alpha', v2 = '1.0.0-alpha.1', want = -1 },
|
{ v1 = '1.0.0-alpha', v2 = '1.0.0-alpha.1', want = -1 },
|
||||||
|
|||||||
Reference in New Issue
Block a user