Last active
April 11, 2024 07:33
-
-
Save wolf81/9483c2c4d4e79ca800e286c37d6c9cbe to your computer and use it in GitHub Desktop.
Sublime Text snippet for a Lua class prototype, invoke by typing `class`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<snippet> | |
<content><![CDATA[ | |
local ${1:ClassName} = {} | |
$1.new = function() | |
$0 | |
return setmetatable({ | |
}, $1) | |
end | |
return setmetatable($1, { | |
__call = function(_, ...) return $1.new(...) end, | |
}) | |
]]></content> | |
<tabTrigger>class</tabTrigger> | |
<description>Add a Lua class with private scope.</description> | |
<scope>source.lua</scope> | |
</snippet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment