feat: add highlighting to editor
This commit is contained in:
+8
-1
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user