Page 1 of 1

Snippets?

Posted: 24 Feb 2017 20:34
by highend
From the roadmap...

How exactly will these look like?

Re: Snippets?

Posted: 24 Feb 2017 21:40
by admin
I barely remember. This thing is on the roadmap for 10 years or so. :mrgreen:

Re: Snippets?

Posted: 27 Feb 2017 16:14
by TheQwerty
They are simple plain text representations of certain user configurations.

The first usage came from right-clicking the Clear button in a CTB's Edit User Button dialog, and looks like this:

Code: Select all

Snip: CTB 1
  XYplorer <xyver>, <date>
Action
  NewUserButton
Name
  <name>
Icon
  <icon>
ScriptL
  <left_script>
ScriptR
  <right_script>
FireClick
  <fire_on_mousedown>
Custom Columns also support them:

Code: Select all

Snip: CustomColumn 1
  XYplorer <xyver>, <date>
Action
  ConfigureColumn
Caption
  <caption>
Type
  <type_index>>
Definition
  <property_template_or_script>
Format
  <format_index>
Trigger
  <trigger_index>
Item Type
  <item_type_index>
Item Filter
  <item_filter>
I believe these are the only two actions currently supported.


My guess is they'll take the form:

Code: Select all

Snip: <snip_category> <snip_version>
  XYplorer <xyver>, <date>
Action
  <snip_config>
<key>
  <value>
...
But maybe Don has better terminology for the category and config fields.

Another way to look at them is as a shortcut to filling out configuration dialogs - with <snip_config> being the key to the specific dialog, and <snip_category> tying it to a specific feature.


I do find it odd that they use this format instead of standard INI, which would be easier to work with in scripts, but this format is friendlier to read without all that syntactic sugar.