make utilities module
This commit is contained in:
+1
-1
@@ -1,5 +1,5 @@
|
||||
use ratatui::{layout::Rect, style::{Color, Stylize}, text::{Line, Span}, widgets::Widget};
|
||||
use crate::{app::App, buffer::Buffer, custom_greys::CustomGreys};
|
||||
use crate::{app::App, buffer::Buffer, utilities::CustomGreys};
|
||||
|
||||
impl Widget for &App {
|
||||
fn render(self, area: Rect, buf: &mut ratatui::buffer::Buffer) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use std::{borrow::Cow, iter, mem};
|
||||
use ratatui::{style::{Color, Style, Stylize}, text::Span};
|
||||
use crate::{buffer::Buffer, cardinality::HasCardinality, cursor::InCursor, custom_greys::CustomGreys, empty_span::empty_span};
|
||||
use crate::{buffer::Buffer, utilities::{CustomGreys, empty_span, HasCardinality}, cursor::InCursor};
|
||||
|
||||
impl Buffer {
|
||||
pub fn render_character_panel(
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::{borrow::Cow, iter::{self, repeat_n}, mem};
|
||||
use itertools::Itertools;
|
||||
use ratatui::{style::{Color, Style, Stylize}, text::Span};
|
||||
|
||||
use crate::{BYTES_PER_CHUNK, BYTES_PER_LINE, CHUNKS_PER_LINE, buffer::{Buffer, Mode, PartialAction}, cardinality::HasCardinality, cursor::InCursor, custom_greys::CustomGreys, empty_span::empty_span};
|
||||
use crate::{BYTES_PER_CHUNK, BYTES_PER_LINE, CHUNKS_PER_LINE, buffer::{Buffer, Mode, PartialAction}, utilities::{CustomGreys, empty_span, HasCardinality}, cursor::InCursor};
|
||||
|
||||
impl Buffer {
|
||||
pub fn render_chunks(
|
||||
@@ -132,7 +132,7 @@ impl Buffer {
|
||||
if let Some(place_in_cursor) = self.primary_cursor.contains(address) {
|
||||
let head_color = match self.mode {
|
||||
Mode::Select => Color::Yellow,
|
||||
_ => Color::Gray
|
||||
Mode::Normal => Color::Gray
|
||||
};
|
||||
|
||||
match place_in_cursor {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::{buffer::{Buffer, Mode}, custom_greys::CustomGreys};
|
||||
use crate::{buffer::{Buffer, Mode}, utilities::CustomGreys};
|
||||
use ratatui::{style::{Color, Stylize}, text::{Line, Span, Text}};
|
||||
|
||||
impl Buffer {
|
||||
|
||||
+1
-3
@@ -23,9 +23,7 @@ mod edit_action;
|
||||
mod arguments;
|
||||
mod window_size;
|
||||
|
||||
mod cardinality;
|
||||
mod empty_span;
|
||||
mod custom_greys;
|
||||
mod utilities;
|
||||
|
||||
const BYTES_PER_LINE: usize = 0x10;
|
||||
const BYTES_PER_CHUNK: usize = 4;
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
mod cardinality;
|
||||
mod empty_span;
|
||||
mod custom_greys;
|
||||
|
||||
pub use cardinality::HasCardinality;
|
||||
pub use empty_span::empty_span;
|
||||
pub use custom_greys::CustomGreys;
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::borrow::Cow;
|
||||
use ratatui::{style::Style, text::Span};
|
||||
|
||||
// this can't just use Span::default() because it needs to be const
|
||||
pub const fn empty_span() -> Span<'static> {
|
||||
Span {
|
||||
style: Style::new(),
|
||||
Reference in New Issue
Block a user