feat: add diff view component
This commit is contained in:
@@ -287,7 +287,7 @@ impl Render for CodeViewState {
|
||||
let selection = self.selection();
|
||||
|
||||
let gutter_chars = line_count.max(1).to_string().len().max(2);
|
||||
let gutter_width = text_size * 0.62 * gutter_chars as f32 + text_size;
|
||||
let gutter_width = text_size * 0.62 * (gutter_chars as f32 + 1.0);
|
||||
|
||||
let bounds_cell: std::rc::Rc<std::cell::RefCell<Option<Bounds<Pixels>>>> =
|
||||
std::rc::Rc::new(std::cell::RefCell::new(None));
|
||||
@@ -611,7 +611,7 @@ fn run_style(role: Role, selected: bool, colors: ColorTokens, ramps: Ramps) -> H
|
||||
}
|
||||
|
||||
/// A gutter cell sized to the whole row.
|
||||
fn gutter_cell<E>(
|
||||
pub(crate) fn gutter_cell<E>(
|
||||
width: Pixels,
|
||||
height: Pixels,
|
||||
mono_font: &'static str,
|
||||
@@ -637,7 +637,7 @@ where
|
||||
}
|
||||
|
||||
/// Maps a highlight role to the theme's semantic palette.
|
||||
fn role_color(role: Role, colors: ColorTokens, ramps: Ramps) -> Hsla {
|
||||
pub(crate) fn role_color(role: Role, colors: ColorTokens, ramps: Ramps) -> Hsla {
|
||||
match role {
|
||||
Role::Text => colors.foreground,
|
||||
Role::Keyword => ramps.primary.base,
|
||||
|
||||
Reference in New Issue
Block a user