Skip to content

Commit cd4adb0

Browse files
committed
Add embed snippet and support function for package detection.
1 parent 411c31d commit cd4adb0

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

actionscript/const.snippet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
${1:public} static const ${2:CONSTANT}:${3:Type} = ${4:value};
1+
${1:public} static const ${2:CONSTANT} : ${3:Type} = ${4:value};${5}

actionscript/embed.snippet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[Embed(source = ${1:source}, mimeType = "${2:application/octet-stream}"${3:, })]

support_functions.vim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,21 @@ function! Snippet_JavaInstanceVarType(name)
8282
return "<+type+>"
8383
endfunction
8484

85+
" actionscript {{{1
86+
function! Snippet_ActionScriptPackageFromPath()
87+
let dir = split(expand("%:p"), "/")
88+
let target_index = 0
89+
let last_index = -1
90+
while 1
91+
let last_index = index(dir, "src", last_index+1, 1)
92+
if last_index != -1
93+
let target_index = last_index
94+
else
95+
break
96+
endif
97+
endwhile
98+
return join(dir[(target_index+1) : -2], '.')
99+
endfunction
85100

86101
"global {{{1
87102
function! s:start_comment()

0 commit comments

Comments
 (0)