Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix header commands to create the correct levels.

  • Loading branch information...
commit d559dd242651d4f233beb7b4d1ed2abdd84cc101 1 parent f35bb4a
@tbates tbates authored infininight committed
View
14 Commands/h1.tmCommand
@@ -36,7 +36,7 @@ foreach ($aLines as $key => $line) {
if ($l>1) {
$o[] = "";
}else{
- $o[] = "$level \${1:Level 1 heading} $level";
+ $o[] = "$newLevel \${1:Level 1 heading} $newLevel";
}
} else {
$new = trim ( $line, " $level" ); //trim existing markers from either end
@@ -49,15 +49,23 @@ echo implode("\n", $o);
<string>line</string>
<key>input</key>
<string>selection</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>@1</string>
<key>name</key>
<string>h1</string>
- <key>output</key>
- <string>insertAsSnippet</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>snippet</string>
+ <key>outputLocation</key>
+ <string>replaceInput</string>
<key>scope</key>
<string>text.html.mediawiki</string>
<key>uuid</key>
<string>3A705702-B6CA-4EC8-9DD9-CD5A1C1C819E</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
View
20 Commands/h2.tmCommand
@@ -13,7 +13,8 @@
// Also Works on multiple lines and lines that already have a heading applied
$level = '=';
-$newLevel = str_repeat ( $level, 2); // Change this to alter the level being affected
+$thisNum = 2;
+$newLevel = str_repeat ( $level, $thisNum); // Change this to alter the level being affected
$o = array();
if (0) { //set to 1 for debugging
@@ -36,7 +37,7 @@ foreach ($aLines as $key =&gt; $line) {
if ($l&gt;1) {
$o[] = "";
}else{
- $o[] = "$level \${1:Level 1 heading} $level";
+ $o[] = "$newLevel \${1:Level $thisNum heading} $newLevel";
}
} else {
$new = trim ( $line, " $level" ); //trim existing markers from either end
@@ -44,20 +45,29 @@ foreach ($aLines as $key =&gt; $line) {
}
}
echo implode("\n", $o);
-?&gt;</string>
+?&gt;
+</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>@2</string>
<key>name</key>
<string>h2</string>
- <key>output</key>
- <string>insertAsSnippet</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>snippet</string>
+ <key>outputLocation</key>
+ <string>replaceInput</string>
<key>scope</key>
<string>text.html.mediawiki</string>
<key>uuid</key>
<string>14B77304-879C-4479-99AF-214D3222ECCC</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
View
20 Commands/h3.tmCommand
@@ -13,7 +13,8 @@
// Also Works on multiple lines and lines that already have a heading applied
$level = '=';
-$newLevel = str_repeat ( $level, 3); // Change this to alter the level being affected
+$thisNum = 3;
+$newLevel = str_repeat ( $level, $thisNum); // Change this to alter the level being affected
$o = array();
if (0) { //set to 1 for debugging
@@ -36,7 +37,7 @@ foreach ($aLines as $key =&gt; $line) {
if ($l&gt;1) {
$o[] = "";
}else{
- $o[] = "$level \${1:Level 1 heading} $level";
+ $o[] = "$newLevel \${1:Level $thisNum heading} $newLevel";
}
} else {
$new = trim ( $line, " $level" ); //trim existing markers from either end
@@ -44,20 +45,29 @@ foreach ($aLines as $key =&gt; $line) {
}
}
echo implode("\n", $o);
-?&gt;</string>
+?&gt;
+</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>@3</string>
<key>name</key>
<string>h3</string>
- <key>output</key>
- <string>insertAsSnippet</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>snippet</string>
+ <key>outputLocation</key>
+ <string>replaceInput</string>
<key>scope</key>
<string>text.html.mediawiki</string>
<key>uuid</key>
<string>C15A6AF0-E218-4891-82C3-F0B2BB2FB773</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
View
20 Commands/h4.tmCommand
@@ -13,7 +13,8 @@
// Also Works on multiple lines and lines that already have a heading applied
$level = '=';
-$newLevel = str_repeat ( $level, 4); // Change this to alter the level being affected
+$thisNum = 4;
+$newLevel = str_repeat ( $level, $thisNum); // Change this to alter the level being affected
$o = array();
if (0) { //set to 1 for debugging
@@ -36,7 +37,7 @@ foreach ($aLines as $key =&gt; $line) {
if ($l&gt;1) {
$o[] = "";
}else{
- $o[] = "$level \${1:Level 1 heading} $level";
+ $o[] = "$newLevel \${1:Level $thisNum heading} $newLevel";
}
} else {
$new = trim ( $line, " $level" ); //trim existing markers from either end
@@ -44,20 +45,29 @@ foreach ($aLines as $key =&gt; $line) {
}
}
echo implode("\n", $o);
-?&gt;</string>
+?&gt;
+</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>@4</string>
<key>name</key>
<string>h4</string>
- <key>output</key>
- <string>insertAsSnippet</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>snippet</string>
+ <key>outputLocation</key>
+ <string>replaceInput</string>
<key>scope</key>
<string>text.html.mediawiki</string>
<key>uuid</key>
<string>C77B0111-D741-40E8-BC04-160C6277FE5D</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
View
20 Commands/h5.tmCommand
@@ -13,7 +13,8 @@
// Also Works on multiple lines and lines that already have a heading applied
$level = '=';
-$newLevel = str_repeat ( $level, 5); // Change this to alter the level being affected
+$thisNum = 5;
+$newLevel = str_repeat ( $level, $thisNum); // Change this to alter the level being affected
$o = array();
if (0) { //set to 1 for debugging
@@ -36,7 +37,7 @@ foreach ($aLines as $key =&gt; $line) {
if ($l&gt;1) {
$o[] = "";
}else{
- $o[] = "$level \${1:Level 1 heading} $level";
+ $o[] = "$newLevel \${1:Level $thisNum heading} $newLevel";
}
} else {
$new = trim ( $line, " $level" ); //trim existing markers from either end
@@ -44,20 +45,29 @@ foreach ($aLines as $key =&gt; $line) {
}
}
echo implode("\n", $o);
-?&gt;</string>
+?&gt;
+</string>
<key>fallbackInput</key>
<string>line</string>
<key>input</key>
<string>selection</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>@5</string>
<key>name</key>
<string>h5</string>
- <key>output</key>
- <string>insertAsSnippet</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>snippet</string>
+ <key>outputLocation</key>
+ <string>replaceInput</string>
<key>scope</key>
<string>text.html.mediawiki</string>
<key>uuid</key>
<string>184223B3-EBEF-4172-B7A8-EA53FEDE2996</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.