Restore Buffer::file field and workspace::Item trait

This commit is contained in:
Max Brunsfeld
2021-05-05 18:08:18 -07:00
parent 78a5d0a378
commit bf28aba1a7
6 changed files with 324 additions and 236 deletions
+2 -2
View File
@@ -324,7 +324,7 @@ mod tests {
fn test_chars_at() {
App::test((), |app| {
let text = sample_text(6, 6);
let buffer = app.add_model(|_| Buffer::new(0, text));
let buffer = app.add_model(|ctx| Buffer::new(0, text, ctx));
let map = app.add_model(|ctx| DisplayMap::new(buffer.clone(), 4, ctx));
buffer
.update(app, |buffer, ctx| {
@@ -391,7 +391,7 @@ mod tests {
#[test]
fn test_max_point() {
App::test((), |app| {
let buffer = app.add_model(|_| Buffer::new(0, "aaa\n\t\tbbb"));
let buffer = app.add_model(|ctx| Buffer::new(0, "aaa\n\t\tbbb", ctx));
let map = app.add_model(|ctx| DisplayMap::new(buffer.clone(), 4, ctx));
assert_eq!(
map.read(app).max_point(app.as_ref()),