File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,13 @@ impl<'a> Formatter<'a> {
302302 . max_inline_arguments
303303 . is_none_or ( |limit| limit < self . indentation . span ( ) )
304304 {
305+ // We inlined something to the top level let's increase the indentation now
306+ if let Some ( ( t, s) ) = self . indentation . previous_top_level_reserved ( ) {
307+ if !s. newline_after {
308+ self . indentation . increase_top_level ( s. clone ( ) ) ;
309+ }
310+ }
311+
305312 self . add_new_line ( query) ;
306313 } else {
307314 self . trim_spaces_end ( query) ;
Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ impl<'a> Indentation<'a> {
7676 folded = kind == Some ( IndentType :: FoldedBlock ) ;
7777 if kind != Some ( IndentType :: Top ) {
7878 break ;
79+ } else {
80+ self . top_level_span . pop ( ) ;
7981 }
8082 }
8183 folded
Original file line number Diff line number Diff line change @@ -2556,7 +2556,7 @@ from
25562556 SELECT true
25572557 FROM bar
25582558 WHERE bar.foo = $99
2559- AND bar.foo > $100
2559+ AND bar.foo > $100
25602560 ),
25612561 c = CASE WHEN $6 THEN NULL ELSE COALESCE($7, c) END,
25622562 d = CASE
You can’t perform that action at this time.
0 commit comments