Fix Buffer::goto_first_whitespace
This commit is contained in:
parent
9558cdadb4
commit
74e1bd88c6
|
@ -274,11 +274,12 @@ impl Buffer {
|
|||
pub fn cursor_at_first_nonwhitespace(&self, line: usize) -> Cursor {
|
||||
if let Some(line_slice) = self.text.get_line(line) {
|
||||
let mut column = 0;
|
||||
for c in line_slice.chars().reversed() {
|
||||
column += 1;
|
||||
for c in line_slice.chars() {
|
||||
if !c.is_whitespace() {
|
||||
break;
|
||||
}
|
||||
|
||||
column += 1;
|
||||
}
|
||||
|
||||
Cursor { line, column }
|
||||
|
|
Loading…
Reference in New Issue