You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Remove the header and begin with the line containing the first license section (we otherwise keep the title for standalone viewing of the licenses text file)
22
+
let license_text = ifletSome(first_underscore_line) = self.license_text.lines().position(|line| line.contains('_')){
23
+
// Find the byte position where the line with underscore starts
24
+
let char_position = self.license_text.split('\n').take(first_underscore_line).map(|line| line.len() + '\n'.len_utf8()).sum();
25
+
self.license_text[char_position..].to_string()
26
+
}else{
27
+
// This shouldn't be encountered, but if no underscore line is found, we use the full text as a safety fallback
28
+
self.license_text.clone()
29
+
};
30
+
31
+
// Two characters (one before, one after) the sequence of underscore characters, plus one additional column to provide a space between the text and the scrollbar
32
+
let non_wrapping_column_width = license_text.split('\n').map(|line| line.chars().filter(|&c| c == '_').count()).max().unwrap_or(0) + 2 + 1;
0 commit comments