MCPcopy Create free account
hub / github.com/bytesnake/vim-graphical-preview / update_metadata

Method update_metadata

src/render.rs:257–269  ·  view source on GitHub ↗
(&mut self, metadata: &str)

Source from the content-addressed store, hash-verified

255 }
256
257 pub fn update_metadata(&mut self, metadata: &str) -> Result<()> {
258 let mut metadata: Metadata = json::from_str(metadata).unwrap();
259 metadata.char_height = utils::char_pixel_height();
260
261 let rerender = metadata.viewport != self.metadata.viewport;
262 if rerender {
263 self.clear_all("")?;
264 }
265
266 self.metadata = metadata;
267
268 Ok(())
269 }
270
271 pub fn update_content(&mut self, content: &str) -> Result<String> {
272 let old_blocks = mem::take(&mut self.blocks);

Callers

nothing calls this directly

Calls 2

char_pixel_heightFunction · 0.85
clear_allMethod · 0.80

Tested by

no test coverage detected