| ... | @@ -3675,26 +3675,6 @@ const AutoIndentingStream = struct { | ... | @@ -3675,26 +3675,6 @@ const AutoIndentingStream = struct { |
| 3675 | try ais.insertNewline(); | 3675 | try ais.insertNewline(); |
| 3676 | } | 3676 | } |
| 3677 | | 3677 | |
| 3678 | /// Push an indent that is automatically popped after being applied | | |
| 3679 | pub fn pushIndentOneShot(ais: *AutoIndentingStream) void { | | |
| 3680 | ais.indent_one_shot_count += 1; | | |
| 3681 | ais.pushIndent(); | | |
| 3682 | } | | |
| 3683 | | | |
| 3684 | /// Turns all one-shot indents into regular indents | | |
| 3685 | /// Returns number of indents that must now be manually popped | | |
| 3686 | pub fn lockOneShotIndent(ais: *AutoIndentingStream) usize { | | |
| 3687 | const locked_count = ais.indent_one_shot_count; | | |
| 3688 | ais.indent_one_shot_count = 0; | | |
| 3689 | return locked_count; | | |
| 3690 | } | | |
| 3691 | | | |
| 3692 | /// Push an indent that should not take effect until the next line | | |
| 3693 | pub fn pushIndentNextLine(ais: *AutoIndentingStream) void { | | |
| 3694 | ais.indent_next_line += 1; | | |
| 3695 | ais.pushIndent(); | | |
| 3696 | } | | |
| 3697 | | | |
| 3698 | /// Checks to see if the most recent indentation exceeds the currently pushed indents | 3678 | /// Checks to see if the most recent indentation exceeds the currently pushed indents |
| 3699 | pub fn isLineOverIndented(ais: *AutoIndentingStream) bool { | 3679 | pub fn isLineOverIndented(ais: *AutoIndentingStream) bool { |
| 3700 | if (ais.current_line_empty) return false; | 3680 | if (ais.current_line_empty) return false; |