@@ -46,8 +46,7 @@ pub fn toggle_line_comments(doc: &Rope, selection: &Selection, token: Option<&st
46 let comment = Tendril::from(format!("{} ", token));
46 let comment = Tendril::from(format!("{} ", token));
48 for selection in selection {
48 for selection in selection {
49− let start = text.char_to_line(selection.from());
49+ let (start, end) = selection.line_range(text);
50− let end = text.char_to_line(selection.to());
51 let lines = start..end + 1;
50 let lines = start..end + 1;
52 let (commented, skipped, min) = find_line_comment(&token, text, lines.clone());
51 let (commented, skipped, min) = find_line_comment(&token, text, lines.clone());