| ... | @@ -1903,28 +1903,23 @@ fn renderCall( | ... | @@ -1903,28 +1903,23 @@ fn renderCall( |
| 1903 | return renderToken(ais, tree, after_last_param_tok + 1, space); // ) | 1903 | return renderToken(ais, tree, after_last_param_tok + 1, space); // ) |
| 1904 | } | 1904 | } |
| 1905 | | 1905 | |
| 1906 | ais.pushIndentNextLine(); | | |
| 1907 | try renderToken(ais, tree, lparen, .none); // ( | 1906 | try renderToken(ais, tree, lparen, .none); // ( |
| 1908 | | 1907 | |
| 1909 | for (params) |param_node, i| { | 1908 | for (params) |param_node, i| { |
| | 1909 | const this_multiline_string = node_tags[param_node] == .multiline_string_literal; |
| | 1910 | if (this_multiline_string) { |
| | 1911 | ais.pushIndentOneShot(); |
| | 1912 | } |
| 1910 | try renderExpression(ais, tree, param_node, .none); | 1913 | try renderExpression(ais, tree, param_node, .none); |
| 1911 | | 1914 | |
| 1912 | if (i + 1 < params.len) { | 1915 | if (i + 1 < params.len) { |
| 1913 | const comma = tree.lastToken(param_node) + 1; | 1916 | const comma = tree.lastToken(param_node) + 1; |
| 1914 | const this_multiline_string = node_tags[param_node] == .multiline_string_literal; | | |
| 1915 | const next_multiline_string = node_tags[params[i + 1]] == .multiline_string_literal; | 1917 | const next_multiline_string = node_tags[params[i + 1]] == .multiline_string_literal; |
| 1916 | const comma_space: Space = if (next_multiline_string) .none else .space; | 1918 | const comma_space: Space = if (next_multiline_string) .none else .space; |
| 1917 | if (this_multiline_string) { | 1919 | try renderToken(ais, tree, comma, comma_space); |
| 1918 | ais.popIndent(); | | |
| 1919 | try renderToken(ais, tree, comma, comma_space); | | |
| 1920 | ais.pushIndent(); | | |
| 1921 | } else { | | |
| 1922 | try renderToken(ais, tree, comma, comma_space); | | |
| 1923 | } | | |
| 1924 | } | 1920 | } |
| 1925 | } | 1921 | } |
| 1926 | | 1922 | |
| 1927 | ais.popIndent(); | | |
| 1928 | return renderToken(ais, tree, after_last_param_tok, space); // ) | 1923 | return renderToken(ais, tree, after_last_param_tok, space); // ) |
| 1929 | } | 1924 | } |
| 1930 | | 1925 | |
| ... | @@ -2234,9 +2229,12 @@ fn AutoIndentingStream(comptime UnderlyingWriter: type) type { | ... | @@ -2234,9 +2229,12 @@ fn AutoIndentingStream(comptime UnderlyingWriter: type) type { |
| 2234 | indent_count: usize = 0, | 2229 | indent_count: usize = 0, |
| 2235 | indent_delta: usize, | 2230 | indent_delta: usize, |
| 2236 | current_line_empty: bool = true, | 2231 | current_line_empty: bool = true, |
| 2237 | indent_one_shot_count: usize = 0, // automatically popped when applied | 2232 | /// automatically popped when applied |
| 2238 | applied_indent: usize = 0, // the most recently applied indent | 2233 | indent_one_shot_count: usize = 0, |
| 2239 | indent_next_line: usize = 0, // not used until the next line | 2234 | /// the most recently applied indent |
| | 2235 | applied_indent: usize = 0, |
| | 2236 | /// not used until the next line |
| | 2237 | indent_next_line: usize = 0, |
| 2240 | | 2238 | |
| 2241 | pub fn writer(self: *Self) Writer { | 2239 | pub fn writer(self: *Self) Writer { |
| 2242 | return .{ .context = self }; | 2240 | return .{ .context = self }; |
| ... | @@ -2291,9 +2289,9 @@ fn AutoIndentingStream(comptime UnderlyingWriter: type) type { | ... | @@ -2291,9 +2289,9 @@ fn AutoIndentingStream(comptime UnderlyingWriter: type) type { |
| 2291 | } | 2289 | } |
| 2292 | | 2290 | |
| 2293 | /// Push default indentation | 2291 | /// Push default indentation |
| | 2292 | /// Doesn't actually write any indentation. |
| | 2293 | /// Just primes the stream to be able to write the correct indentation if it needs to. |
| 2294 | pub fn pushIndent(self: *Self) void { | 2294 | pub fn pushIndent(self: *Self) void { |
| 2295 | // Doesn't actually write any indentation. | | |
| 2296 | // Just primes the stream to be able to write the correct indentation if it needs to. | | |
| 2297 | self.indent_count += 1; | 2295 | self.indent_count += 1; |
| 2298 | } | 2296 | } |
| 2299 | | 2297 | |