Editor: Fix SoftHome
This commit is contained in:
parent
d7e066c105
commit
c79c132694
1 changed files with 2 additions and 2 deletions
|
|
@ -452,8 +452,8 @@ impl Edit for Editor {
|
||||||
let line: &mut BufferLine = &mut self.buffer.lines[self.cursor.line];
|
let line: &mut BufferLine = &mut self.buffer.lines[self.cursor.line];
|
||||||
self.cursor.index = line
|
self.cursor.index = line
|
||||||
.text()
|
.text()
|
||||||
.unicode_word_indices()
|
.char_indices()
|
||||||
.map(|(i, _)| i)
|
.filter_map(|(i, c)| if c.is_whitespace() { None } else { Some(i) })
|
||||||
.next()
|
.next()
|
||||||
.unwrap_or(0);
|
.unwrap_or(0);
|
||||||
self.buffer.set_redraw(true);
|
self.buffer.set_redraw(true);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue