Skip to content

Commit 39b76c4

Browse files
author
Monte Goulding
committed
Improve support for if...then...else control structure
This commit adds support for: if condition then something1 else something2 It also adds support for the following with a quirk on the else. Atom seems to decrease the indent when it hits a match but doesn't increase it again when it no longer matches. This means when you are typing else it will step back at the end of the word and if you keep typing it stays at the wrong indent instead of popping back as it should. Using the menu to reset the indents does fix it though. I guess this is reportable on Atom... if condition then something1 else something2
1 parent d7bd4aa commit 39b76c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

settings/language-livecode.cson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454

5555
".source.livecodescript, .source.iRev":
5656
'editor':
57-
'increaseIndentPattern': "(^on\\s+?.+)|(^command\\s+?.+)|(^function\\s+?.+)|(\\s*if\\s+?.+)|(\\s*else)|(\\s*repeat\\s+?.+)|(switch\\s+?.+)|(case\\s+?.+)|(\\s*default)|(\\s*(?<!end )try$)|(\\s*catch\\s+?.+)"
58-
'decreaseIndentPattern': "(\\s*end\\s+?.+)|(case\\s+?.+)|(\\s*default)|(\\s*else$)|(\\s*catch\\s+?.+)"
57+
'increaseIndentPattern': "(^on\\s+?.+)|(^command\\s+?.+)|(^function\\s+?.+)|(\\s*if\\s+?.+then$)|(^\\s*else$)|(\\s*repeat\\s+?.+)|(switch\\s+?.+)|(case\\s+?.+)|(\\s*default)|(\\s*(?<!end )try$)|(\\s*catch\\s+?.+)"
58+
'decreaseIndentPattern': "(\\s*end\\s+?.+)|(case\\s+?.+)|(\\s*default)|(^\\s*else$)|(\\s*catch\\s+?.+)"
5959
'tabLength': 3
6060
'foldEndPattern': '^\\s*end\\b'
6161
autocomplete:

0 commit comments

Comments
 (0)