pub struct CharMap {
pub map: HashMap<usize, Vec<(usize, usize)>>,
}
Expand description
Keeps notes of specific characters within a document for the purposes of double width and tab characters, which have display widths different to that of their character width
Fields§
§map: HashMap<usize, Vec<(usize, usize)>>
Implementations§
source§impl CharMap
impl CharMap
sourcepub fn splice(&mut self, loc: &Loc, start: usize, slice: Vec<(usize, usize)>)
pub fn splice(&mut self, loc: &Loc, start: usize, slice: Vec<(usize, usize)>)
Add a slice to the map
sourcepub fn shift_insertion(
&mut self,
loc: &Loc,
st: &str,
tab_width: usize
) -> usize
pub fn shift_insertion( &mut self, loc: &Loc, st: &str, tab_width: usize ) -> usize
Shift entries up in the character map
sourcepub fn shift_deletion(
&mut self,
loc: &Loc,
x: (usize, usize),
st: &str,
tab_width: usize
)
pub fn shift_deletion( &mut self, loc: &Loc, x: (usize, usize), st: &str, tab_width: usize )
Shift entries down in the character map
sourcepub fn shift_down(&mut self, loc: usize)
pub fn shift_down(&mut self, loc: usize)
Shift lines in the character map down one
Trait Implementations§
source§impl PartialEq for CharMap
impl PartialEq for CharMap
impl Eq for CharMap
impl StructuralPartialEq for CharMap
Auto Trait Implementations§
impl RefUnwindSafe for CharMap
impl Send for CharMap
impl Sync for CharMap
impl Unpin for CharMap
impl UnwindSafe for CharMap
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more