Synchronize FoldMap with buffer's contents lazily
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
co-authored by
Nathan Sobo
parent
c135c84ef0
commit
05ab1bdddf
@@ -96,7 +96,7 @@ pub fn prev_word_boundary(
|
||||
let mut boundary = DisplayPoint::new(point.row(), 0);
|
||||
let mut column = 0;
|
||||
let mut prev_c = None;
|
||||
for c in map.chars_at(boundary, app)? {
|
||||
for c in map.snapshot(app).chars_at(boundary, app)? {
|
||||
if column >= point.column() {
|
||||
break;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ pub fn next_word_boundary(
|
||||
app: &AppContext,
|
||||
) -> Result<DisplayPoint> {
|
||||
let mut prev_c = None;
|
||||
for c in map.chars_at(point, app)? {
|
||||
for c in map.snapshot(app).chars_at(point, app)? {
|
||||
if prev_c.is_some() && (c == '\n' || char_kind(prev_c.unwrap()) != char_kind(c)) {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user