Add #[track_caller]
to test utilities that involve marked text (#32043)
Release Notes: - N/A
This commit is contained in:
parent
030d4d2631
commit
48eacf3f2a
7 changed files with 12 additions and 0 deletions
|
@ -1662,11 +1662,13 @@ impl Buffer {
|
|||
|
||||
#[cfg(any(test, feature = "test-support"))]
|
||||
impl Buffer {
|
||||
#[track_caller]
|
||||
pub fn edit_via_marked_text(&mut self, marked_string: &str) {
|
||||
let edits = self.edits_for_marked_text(marked_string);
|
||||
self.edit(edits);
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
pub fn edits_for_marked_text(&self, marked_string: &str) -> Vec<(Range<usize>, String)> {
|
||||
let old_text = self.text();
|
||||
let (new_text, mut ranges) = util::test::marked_text_ranges(marked_string, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue