Skip to content

Commit

Permalink
Merge pull request #86 from Etto48/fix/formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Etto48 authored Jul 1, 2024
2 parents 175be4a + b34a4fa commit c2e9816
Show file tree
Hide file tree
Showing 66 changed files with 4,010 additions and 3,926 deletions.
5 changes: 2 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
extern crate winres;

#[cfg(windows)]
fn main() -> Result<(), Box<dyn std::error::Error>>
{
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut res = winres::WindowsResource::new();
res.set_icon("docs/assets/logo.ico");
res.set("OriginalFilename", "hex-patch.exe");
Expand All @@ -14,4 +13,4 @@ fn main() -> Result<(), Box<dyn std::error::Error>>
}

#[cfg(unix)]
fn main() {}
fn main() {}
28 changes: 12 additions & 16 deletions src/app/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@ use ratatui::text::{Line, Span, Text};

use super::App;

impl App
{
pub(super) fn get_address_view(&self, start_row: usize, end_row: usize) -> Text<'static>
{
impl App {
pub(super) fn get_address_view(&self, start_row: usize, end_row: usize) -> Text<'static> {
let mut ret = Text::default();
ret.lines.reserve(end_row - start_row);
let selected_row = self.get_cursor_position().line_index;
for i in start_row..end_row
{
for i in start_row..end_row {
let mut line = Line::default();
line.spans.push(Span::styled(format!("{:16X}", i * self.block_size * self.blocks_per_row),
if i == selected_row
{
self.settings.color.address_selected
}
else
{
self.settings.color.address_default
}));
line.spans.push(Span::styled(
format!("{:16X}", i * self.block_size * self.blocks_per_row),
if i == selected_row {
self.settings.color.address_selected
} else {
self.settings.color.address_default
},
));
ret.lines.push(line);
}
ret
}
}
}
Loading

0 comments on commit c2e9816

Please sign in to comment.