mirror of
https://github.com/itsjunetime/tdf.git
synced 2026-06-01 23:51:46 -04:00
Fix TODOs
Fixes non UTF8 filenames by not converting to `String` for no reason. Also removes TODO for the fill-page feature, which already exists.
This commit is contained in:
+1
-4
@@ -209,10 +209,6 @@ async fn inner_main() -> Result<(), WrappedErr> {
|
||||
)
|
||||
.map_err(|e| WrappedErr(format!("Can't watch the provided file: {e}").into()))?;
|
||||
|
||||
// TODO: Handle non-utf8 file names? Maybe by constructing a CString and passing that in to the
|
||||
// mupdf stuff instead of a rust string?
|
||||
let file_path = path.clone().into_os_string().to_string_lossy().to_string();
|
||||
|
||||
let mut window_size = window_size().map_err(|e| {
|
||||
WrappedErr(format!("Can't get your current terminal window size: {e}").into())
|
||||
})?;
|
||||
@@ -266,6 +262,7 @@ async fn inner_main() -> Result<(), WrappedErr> {
|
||||
.and_then(NonZeroUsize::new)
|
||||
.map_or(PrerenderLimit::All, PrerenderLimit::Limited);
|
||||
|
||||
let file_path = path.clone();
|
||||
std::thread::spawn(move || {
|
||||
renderer::start_rendering(
|
||||
&file_path,
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
use std::{collections::VecDeque, num::NonZeroUsize, thread::sleep, time::Duration};
|
||||
use std::{collections::VecDeque, num::NonZeroUsize, path::Path, thread::sleep, time::Duration};
|
||||
|
||||
use flume::{Receiver, SendError, Sender, TryRecvError};
|
||||
use mupdf::{
|
||||
@@ -80,7 +80,7 @@ pub fn fill_default<T: Default>(vec: &mut Vec<T>, size: usize) {
|
||||
// probably be more performant if accessed by-value instead of through a reference. Probably.
|
||||
#[expect(clippy::needless_pass_by_value, clippy::too_many_arguments)]
|
||||
pub fn start_rendering(
|
||||
path: &str,
|
||||
path: &Path,
|
||||
sender: Sender<Result<RenderInfo, RenderError>>,
|
||||
receiver: Receiver<RenderNotif>,
|
||||
col_h: u16,
|
||||
|
||||
@@ -346,7 +346,6 @@ impl Tui {
|
||||
}])
|
||||
}
|
||||
|
||||
// TODO: Make a way to fill the width of the screen with one page and scroll down to view it
|
||||
#[must_use]
|
||||
pub fn render<'s>(
|
||||
&'s mut self,
|
||||
|
||||
Reference in New Issue
Block a user