Skip to main content

column_at

Function column_at 

Source
pub fn column_at(line: &str, col: usize) -> usize
Expand description

Which cell contains byte offset col on line.

Counts the unescaped | to the left of the caret — the same split layout::cells makes, so the answer agrees with the parse. A caret before the leading pipe (in the indent) is in cell 0: it is the cell you would reach by pressing l, and answering None there would make <Tab> dead on a line the user is plainly inside.