Merge pull request #562 from chavezgu/master

Change for, if, else, and struct to K&R style.
This commit is contained in:
Louis Pilfold 2015-04-14 09:55:05 +01:00
commit 4aa9337127

View File

@ -46,15 +46,13 @@ int main(int argc, char *argv[])
endsnippet endsnippet
snippet for "for loop (for)" snippet for "for loop (for)"
for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
{
${VISUAL}${0} ${VISUAL}${0}
} }
endsnippet endsnippet
snippet fori "for int loop (fori)" snippet fori "for int loop (fori)"
for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) {
{
${VISUAL}${0} ${VISUAL}${0}
} }
endsnippet endsnippet
@ -100,8 +98,7 @@ fprintf(${1:stderr}, "${2:%s}\n"${2/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$3${2/([^%]|%
endsnippet endsnippet
snippet if "if .. (if)" snippet if "if .. (if)"
if (${1:/* condition */}) if (${1:/* condition */}) {
{
${VISUAL}${0} ${VISUAL}${0}
} }
endsnippet endsnippet
@ -119,12 +116,9 @@ else if (${1:/* condition */}) {
endsnippet endsnippet
snippet ife "if .. else (ife)" snippet ife "if .. else (ife)"
if (${1:/* condition */}) if (${1:/* condition */}) {
{
${2} ${2}
} } else {
else
{
${3:/* else */} ${3:/* else */}
} }
endsnippet endsnippet
@ -134,8 +128,7 @@ printf("${1:%s}\n"${1/([^%]|%%)*(%.)?.*/(?2:, :\);)/}$2${1/([^%]|%%)*(%.)?.*/(?2
endsnippet endsnippet
snippet st "struct" snippet st "struct"
struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} {
{
${0:/* data */} ${0:/* data */}
}; };
endsnippet endsnippet