| ... | ... | @@ -1941,15 +1941,24 @@ fn renderTokenOffset( |
| 1941 | 1941 | } |
| 1942 | 1942 | } |
| 1943 | 1943 | |
| 1944 | | const comment_is_empty = mem.trimRight(u8, tree.tokenSlicePtr(next_token), " ").len == 2; |
| 1945 | | if (comment_is_empty) { |
| 1946 | | switch (space) { |
| 1947 | | Space.Newline => { |
| 1948 | | try stream.writeByte('\n'); |
| 1949 | | start_col.* = 0; |
| 1950 | | return; |
| 1951 | | }, |
| 1952 | | else => {}, |
| 1944 | while (true) { |
| 1945 | const comment_is_empty = mem.trimRight(u8, tree.tokenSlicePtr(next_token), " ").len == 2; |
| 1946 | if (comment_is_empty) { |
| 1947 | switch (space) { |
| 1948 | Space.Newline => { |
| 1949 | offset += 1; |
| 1950 | token = next_token; |
| 1951 | next_token = tree.tokens.at(token_index + offset); |
| 1952 | if (next_token.id != .LineComment) { |
| 1953 | try stream.writeByte('\n'); |
| 1954 | start_col.* = 0; |
| 1955 | return; |
| 1956 | } |
| 1957 | }, |
| 1958 | else => break, |
| 1959 | } |
| 1960 | } else { |
| 1961 | break; |
| 1953 | 1962 | } |
| 1954 | 1963 | } |
| 1955 | 1964 | |