mirror of
https://github.com/encounter/objdiff.git
synced 2025-06-07 23:23:34 +00:00
Fix highlighting of signed vs unsigned arguments (#202)
* Fix signed and unsigned arguments not being considered equal when highlighting * Remove unused Eq derive
This commit is contained in:
parent
2d643eb071
commit
731b604c24
@ -77,7 +77,7 @@ impl<'a> DiffTextSegment<'a> {
|
|||||||
const EOL_SEGMENT: DiffTextSegment<'static> =
|
const EOL_SEGMENT: DiffTextSegment<'static> =
|
||||||
DiffTextSegment { text: DiffText::Eol, color: DiffTextColor::Normal, pad_to: 0 };
|
DiffTextSegment { text: DiffText::Eol, color: DiffTextColor::Normal, pad_to: 0 };
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Eq)]
|
#[derive(Debug, Default, Clone)]
|
||||||
pub enum HighlightKind {
|
pub enum HighlightKind {
|
||||||
#[default]
|
#[default]
|
||||||
None,
|
None,
|
||||||
@ -288,6 +288,18 @@ pub fn display_row(
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PartialEq<HighlightKind> for HighlightKind {
|
||||||
|
fn eq(&self, other: &HighlightKind) -> bool {
|
||||||
|
match (self, other) {
|
||||||
|
(HighlightKind::Opcode(a), HighlightKind::Opcode(b)) => a == b,
|
||||||
|
(HighlightKind::Argument(a), HighlightKind::Argument(b)) => a.loose_eq(b),
|
||||||
|
(HighlightKind::Symbol(a), HighlightKind::Symbol(b)) => a == b,
|
||||||
|
(HighlightKind::Address(a), HighlightKind::Address(b)) => a == b,
|
||||||
|
_ => false,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl PartialEq<DiffText<'_>> for HighlightKind {
|
impl PartialEq<DiffText<'_>> for HighlightKind {
|
||||||
fn eq(&self, other: &DiffText) -> bool {
|
fn eq(&self, other: &DiffText) -> bool {
|
||||||
match (self, other) {
|
match (self, other) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user