feat: add highlighting to editor

This commit is contained in:
Stevan Freeborn
2026-01-24 21:24:32 -06:00
parent cfad6c883c
commit 75ab718655
3 changed files with 32 additions and 24 deletions
+8 -1
View File
@@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::{ffi, path::{Path, PathBuf}};
use iced::widget::{markdown, text_editor};
@@ -58,6 +58,13 @@ impl File {
self.path = path;
}
pub fn extension(&self) -> Option<&str> {
self.path
.as_deref()
.and_then(Path::extension)
.and_then(ffi::OsStr::to_str)
}
pub fn display_name(&self) -> &str {
self.path
.as_deref()