[][src]Function cmark_gfm_sys::cmark_parser_get_column

pub unsafe extern "C" fn cmark_parser_get_column(
    parser: *mut cmark_parser
) -> c_int

Return the offset in 'columns' in the line being processed.

This value may differ from the value returned by cmark_parser_get_offset() in that it accounts for tabs, and as such should not be used as an index in the current line's buffer.

Example:

cmark_parser_advance_offset() can be called to advance the offset by a number of columns, instead of a number of bytes.

In that case, if offset falls "in the middle" of a tab character, 'column' and offset will differ.

foo                 \t bar
^                   ^^
offset (0)          20

If cmark_parser_advance_offset is called here with 'columns' set to 'true' and 'offset' set to 22, cmark_parser_get_offset() will return 20, whereas cmark_parser_get_column() will return 22.

Additionally, as tabs expand to the next multiple of 4 column, cmark_parser_has_partially_consumed_tab() will now return 'true'.