Remove ExcerptProperties struct
Pass buffer and range as separate parameters Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
b67be5ded3
commit
aa7dfbdd9c
4 changed files with 54 additions and 191 deletions
|
@ -225,7 +225,7 @@ pub fn surrounding_word(map: &DisplaySnapshot, position: DisplayPoint) -> Range<
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{Buffer, DisplayMap, ExcerptProperties, MultiBuffer};
|
||||
use crate::{Buffer, DisplayMap, MultiBuffer};
|
||||
use language::Point;
|
||||
|
||||
#[gpui::test]
|
||||
|
@ -239,20 +239,8 @@ mod tests {
|
|||
let buffer = cx.add_model(|cx| Buffer::new(0, "abc\ndefg\nhijkl\nmn", cx));
|
||||
let multibuffer = cx.add_model(|cx| {
|
||||
let mut multibuffer = MultiBuffer::new(0);
|
||||
multibuffer.push_excerpt(
|
||||
ExcerptProperties {
|
||||
buffer: &buffer,
|
||||
range: Point::new(0, 0)..Point::new(1, 4),
|
||||
},
|
||||
cx,
|
||||
);
|
||||
multibuffer.push_excerpt(
|
||||
ExcerptProperties {
|
||||
buffer: &buffer,
|
||||
range: Point::new(2, 0)..Point::new(3, 2),
|
||||
},
|
||||
cx,
|
||||
);
|
||||
multibuffer.push_excerpt(buffer.clone(), Point::new(0, 0)..Point::new(1, 4), cx);
|
||||
multibuffer.push_excerpt(buffer.clone(), Point::new(2, 0)..Point::new(3, 2), cx);
|
||||
multibuffer
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue