mirror of
https://github.com/Reuh/language-candran.git
synced 2025-10-27 12:19:30 +00:00
Merge pull request #11 from rm-code/snippets
Add snippet for creating a local function
This commit is contained in:
commit
f3c8495dcf
2 changed files with 4 additions and 0 deletions
|
|
@ -21,6 +21,7 @@ Common snippets
|
|||
| ife | if else conditional | if value then --body... else --body... end |
|
||||
| ifn | if not conditional | if not value then --body... end |
|
||||
| ifne | if not else conditional | if not value then --body... else --body... end |
|
||||
| lfun | local function | local function functionName (args) -- body... end |
|
||||
| loc | local variable definition shortcut | local x = 1 |
|
||||
| local | local variable definition | local x = 1 |
|
||||
| ltab | local table definition | local name = {} |
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@
|
|||
'for k,v in pairs()':
|
||||
'prefix': 'forp'
|
||||
'body': 'for ${1:k},${2:v} in pairs(${3:table_name}) do\n\t${0:-- body...}\nend'
|
||||
'local function':
|
||||
'prefix': 'lfun'
|
||||
'body': 'local function ${1:FunctionName} (${2:args})\n\t${0:-- body...}\nend'
|
||||
'local variable definition':
|
||||
'prefix': 'local'
|
||||
'body': 'local ${1:x} = ${0:1}'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue