New feature: Code templates
-
@Christoph-Hart Nice, reminds me of the snippets feature in Sublime Text
-
Nice feature!
A possible snippet could be for a callback function that is assigned to an array of params that has an index! I find that I've been writing those a lot.
-
@Christoph-Hart Thanks Christoph!! Nice one.
-
@Christoph-Hart amazing!
-
A possible snippet could be for a callback function that is assigned to an array of params that has an index! I find that I've been writing those a lot.
Like this?
{ "name": "multi button callback (...)", "language": "HiseScript", "code": "inline function on$UI_CONTROL$s(component, value)\n{\n\tlocal index = $UI_CONTROL$s.indexOf(component);\n\n\tConsole.print(index + \": \" + value);\n};\n\nconst var $UI_CONTROL$s = Content.getAllComponents(\"$UI_CONTROL$\");\n\nfor(b in $UI_CONTROL$s)\n\tb.setControlCallback(on$UI_CONTROL$s);", "description": "This template will create a list of all UI components that match the regex expression and assign a callback with an index to them. \n>Use Ctrl+D to select all instances of `UI_CONTROL`, then enter the **common** string that all UI controls share.", "priority": 100 },
-
@Christoph-Hart Yep that looks great!
Idk if it was just an example name but would there be a way to generalize it more than a "multi button callback"?
maybe something like "multi-parameter callback"?
-
I am stuck in a situation where the above GIF not working. I gave it a try after following the @Christoph-Hart GIF. But Autocomplete is not working. What am I missing ?
BTW, I have updated to the latest code. -
@Christoph-Hart good work!
-
The switch statement is probably a good contender here.
-
@DabDab said in New feature: Code templates:
I am stuck in a situation where the above GIF not working. I gave it a try after following the @Christoph-Hart GIF. But Autocomplete is not working. What am I missing ?
BTW, I have updated to the latest code.New commits has fixed the issue..
Now it is working. Now I have two questions .-
How can I select multiple text at a time that @Christoph-Hart has shown here ?
Interface: The CSS renderer is still experimental, so use with precaution.
What are the precaution ?
-