Skip to content

Multiple identical hotspots

erinata edited this page May 4, 2012 · 6 revisions

If the snippets contain multiple Hotspots with the same default value. The will be triggered simultaneously. It means that you can edit them simultaneously.

For example,

Snippet Content:

for ($[![i]!] = 0; $[![i]!] < $[![max]!]; $[![i]!]++) {
    $[![]!]
}

When you trigger this snippet, all the hotspot $[![i]!] will be triggered. Therefore, if you type j, the text will become:

for (j = 0; j < $[![max]!]; j++) {
    $[![]!]
}

And all the i are changed to j.

Another example:

Snippet Content:

<$[![div]!]>$[![]!]</$[![div]!]>    <!-- This is a $[![div]!] tag -->

If you hit [tab] once after triggering this snippet, the default value div is accepted:

<div>$[![]!]</div>    <!-- This is a div tag -->

But if you type span after triggering this snippet, the text will become:

<span>$[![]!]</span>    <!-- This is a span tag -->

This feature saves a lot of repetitive typing.

Notice that empty hotspots $[![]!] are NOT considered as identical hotspots. Therefore, when you trigger the following snippet:

Snippet Content:

if (x > 0) {
    $[![]!]
} else {
    $[![]!]
}

Those two $[![]!] will be triggered one by one instead of simultaneously.

Back to Main Page