Merge branch 'master' of github.com:yannickreiss/nvim_cfg

This commit is contained in:
Yannick Reiß 2023-09-22 11:34:41 +02:00
commit 890a432a4e
No known key found for this signature in database
GPG Key ID: 5A3AF456F0A0338C
2 changed files with 11 additions and 13 deletions

View File

@ -53,7 +53,7 @@ params = t[3].replace(", ", ",").split(",")
rval = ""
for param in params:
if len(param.split(' ')) >= 2:
rval += f"\n *\t@param {param}:\t{t[2]}_{param.split(' ')[1]}"
rval += f"\n *\t@param {param}"
snip.rv = rval`
*/
${1:int} ${2:MyFunc} (${3:void});
@ -69,7 +69,7 @@ params = t[3].replace(", ", ",").split(",")
rval = ""
for param in params:
if len(param.split(' ')) >= 2:
rval += f"\n *\t@param {param}:\t{t[2]}_{param.split(' ')[1]}"
rval += f"\n *\t@param {param}"
snip.rv = rval`
*/
${1:int} ${2:MyFunc} (${3:void}) {
@ -97,7 +97,7 @@ endsnippet
snippet "(\w+) = malloc" "Automativ malloc error implementation" rA
/* Allocate memory for `!p snip.rv = match.group(1)` */
`!p snip.rv = match.group(1)` = malloc(sizeof(${1:int}) * $2);
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
if (!`!p snip.rv = match.group(1)`) {
/* Error */
perror("malloc error on memory allocation of: `!p snip.rv = match.group(1)`");

View File

@ -16,17 +16,16 @@ endsnippet
snippet exfun "New Function with Documentation"
/**
* $2 -> $1
* @name $2
* @return $1
* @brief Description:
* ${4: Description}
* @brief ${4: Description}
*
@param `!p
`!p
params = t[3].split(", ")
rval = ""
for param in params:
if len(param.split(' ')) == 2:
rval += f" * {param}:\t{t[2]}_{param.split(' ')[1]}\n"
rval += f" * @param {param}:\t{t[2]}_{param.split(' ')[1]}\n"
snip.rv = rval`
*/
${1:int} ${2:MyFunc} (${3:void}) {
@ -182,16 +181,15 @@ endsnippet
snippet pfun "prototype for function" bA
/**
* $2 -> $1
* @name $2
* @return $1
* @brief Description:
* ${4: Description}
* @param Parameter:`!p
* @brief ${4: Description}
* `!p
params = t[3].split(", ")
rval = ""
for param in params:
if len(param.split(' ')) >= 2:
rval += f"\n *\t\t{param}:\t{t[2]}_{param.split(' ')[1]}"
rval += f"\n *\t@param {param}:\t{t[2]}_{param.split(' ')[1]}"
snip.rv = rval`
*/
${1:int} ${2:MyFunc} (${3:void});