Skip to content

Commit c5d1560

Browse files
nicolasstuckismarter
authored andcommitted
vscode-dotty: auto-unindent end
Auto-unindent completed `end` folowed by `while`, `for`, `match`, `try`, `if`
1 parent 2113a7b commit c5d1560

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

vscode-dotty/src/extension.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,8 @@ export function activate(context: ExtensionContext) {
6060
// 3. Auto-indent after `then`, `else`, `do`, `catch`, `finally`, `yield`, `case`, `=`, `=>`, `<-`, `=>>`x
6161
"increaseIndentPattern":
6262
/(((?<!\bend\b\s*?)\b(if|while|for|match|try))|(\bif\s+(?!.*?\bthen\b.*?$)[^\s]*?)|(\b(then|else|do|catch|finally|yield|case))|=|=>|<-|=>>)\s*?$/,
63-
// Auto-unindent disabled, because it doesn't work well with all
64-
// indentation styles
65-
"decreaseIndentPattern": /^.$/
63+
// Only auto-unindent completed `end` folowed by `while`, `for`, `match`, `try`, `if`
64+
"decreaseIndentPattern": /(^\s*end\b\s*)\b(if|while|for|match|try)$/
6665
}
6766
})
6867

0 commit comments

Comments
 (0)