diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-11-27 18:35:36 -0500 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-11-27 18:35:36 -0500 |
commit | 186e9a1f9efcb3832a2e3deff8243d8e9c4de6b2 (patch) | |
tree | 0057009a735bde5b169e8ff5bba998564d5bc605 /src/context | |
parent | 14ed540354eab0feb2f65b47a63f46e0ae34203b (diff) |
add scrolling support to file preview
Diffstat (limited to 'src/context')
-rw-r--r-- | src/context/preview_context.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/context/preview_context.rs b/src/context/preview_context.rs index 2483ec0..d08371c 100644 --- a/src/context/preview_context.rs +++ b/src/context/preview_context.rs @@ -18,10 +18,14 @@ impl PreviewContext { self.previews.get(p).is_some() } - pub fn get_preview(&self, p: &path::Path) -> Option<&Option<FilePreview>> { + pub fn get_preview_ref(&self, p: &path::Path) -> Option<&Option<FilePreview>> { self.previews.get(p) } + pub fn get_preview_mut(&mut self, p: &path::Path) -> Option<&mut Option<FilePreview>> { + self.previews.get_mut(p) + } + pub fn insert_preview(&mut self, p: path::PathBuf, preview: Option<FilePreview>) { self.previews.insert(p, preview); } |