Function piet::util::trailing_nlf

source ·
pub fn trailing_nlf(s: &str) -> Option<usize>
Expand description

If this string ends in a newline function (NLF) (5.8), return the length of the NLF in bytes.

Note: this is currently just handling the newline character, \\n. When a line ends in a newline and a user clicks at the end of that line, you generally want to insert the cursor before that character.

In the future, we may want to respect other separators, as per the unicode spec.