move colum state over

This commit is contained in:
Folkert 2022-05-16 21:39:57 +02:00
parent 1a49930d1d
commit 256e7adaff
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 7 additions and 3 deletions

View file

@ -197,7 +197,11 @@ where
Err((MadeProgress, indent_problem(state.pos()), state))
} else {
let comments_and_newlines = Vec::with_capacity_in(newlines, arena);
let spaces = eat_spaces(state, false, comments_and_newlines);
let mut spaces = eat_spaces(state, false, comments_and_newlines);
if spaces.multiline {
spaces.state.indent_column = spaces.state.column();
}
Ok((
MadeProgress,

View file

@ -13,11 +13,11 @@ pub struct State<'a> {
offset: usize,
/// Position of the start of the current line
pub line_start: Position,
pub(crate) line_start: Position,
/// Current indentation level, in columns
/// (so no indent is col 1 - this saves an arithmetic operation.)
pub indent_column: u32,
pub(crate) indent_column: u32,
}
impl<'a> State<'a> {