mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 09:44:31 +00:00 
			
		
		
		
	ref #9280 Introduce the `vim.compat` module, to help environments with system Lua 5.2+ run the build/tests. Include the module implicitly in all tests. ref #8677 legacy `vim` module: beep buffer command dict eval firstline lastline line list open type window
		
			
				
	
	
		
			13 lines
		
	
	
		
			520 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			520 B
		
	
	
	
		
			Lua
		
	
	
	
	
	
-- Lua 5.1 forward-compatibility layer.
 | 
						|
-- For background see https://github.com/neovim/neovim/pull/9280
 | 
						|
--
 | 
						|
-- Reference the lua-compat-5.2 project for hints:
 | 
						|
--    https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/compat52/mstrict.lua
 | 
						|
--    https://github.com/keplerproject/lua-compat-5.2/blob/c164c8f339b95451b572d6b4b4d11e944dc7169d/tests/test.lua
 | 
						|
 | 
						|
local lua_version = _VERSION:sub(-3)
 | 
						|
 | 
						|
if lua_version >= "5.2" then
 | 
						|
  unpack = table.unpack  -- luacheck: ignore 121 143
 | 
						|
end
 |