Move highlighted_text_in_range from Buffer to buffer::Snapshot

This commit is contained in:
Antonio Scandurra
2021-05-25 11:51:29 +02:00
parent e54a31ead2
commit aeb68867da
6 changed files with 182 additions and 200 deletions
+3 -2
View File
@@ -1483,7 +1483,8 @@ mod tests {
let path = tree.update(&mut app, |tree, ctx| {
let path = tree.files(0).next().unwrap().path().clone();
assert_eq!(path.file_name().unwrap(), "file1");
smol::block_on(tree.save(&path, buffer.read(ctx).snapshot(), ctx.as_ref())).unwrap();
smol::block_on(tree.save(&path, buffer.read(ctx).snapshot().text(), ctx.as_ref()))
.unwrap();
path
});
@@ -1512,7 +1513,7 @@ mod tests {
let file = app.update(|ctx| tree.file("", ctx)).await;
app.update(|ctx| {
assert_eq!(file.path().file_name(), None);
smol::block_on(file.save(buffer.read(ctx).snapshot(), ctx.as_ref())).unwrap();
smol::block_on(file.save(buffer.read(ctx).snapshot().text(), ctx.as_ref())).unwrap();
});
let history = app.read(|ctx| file.load_history(ctx)).await.unwrap();