Handle bullshitium for 🔚.

This commit is contained in:
Tom Alexander
2023-10-18 11:57:39 -04:00
parent bcdf1f5e9d
commit b0b287cd47
5 changed files with 92 additions and 2 deletions

View File

@@ -82,6 +82,16 @@ impl<'s> OrgSource<'s> {
self.slice(..(other.end - self.start))
}
pub(crate) fn get_until_end_of_str(&self, other: &'s str) -> OrgSource<'s> {
let full_source_start = self.full_source.as_ptr() as usize;
let full_found_end = full_source_start + self.full_source.len();
let other_start = other.as_ptr() as usize - full_source_start;
let other_end = other_start + other.len();
debug_assert!(other_start >= self.start);
debug_assert!(other_end <= self.end);
self.slice(..(other_end - self.start))
}
pub(crate) fn get_start_of_line(&self) -> OrgSource<'s> {
let skipped_text = self.text_since_line_break();
let mut bracket_depth = self.bracket_depth;