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

Method update_content

src/render.rs:271–284  ·  view source on GitHub ↗
(&mut self, content: &str)

Source from the content-addressed store, hash-verified

269 }
270
271 pub fn update_content(&mut self, content: &str) -> Result<String> {
272 let old_blocks = mem::take(&mut self.blocks);
273 let (nodes, strcts, folds, any_changed) = self.content.process(content, old_blocks)?;
274
275 self.strcts = strcts;
276 self.blocks = nodes;
277
278 let ret = RedrawState {
279 should_redraw: any_changed,
280 update_folding: Some(folds),
281 };
282
283 Ok(json::to_string(&ret))
284 }
285
286 pub fn set_folds(&mut self, folds: &str) -> Result<usize> {
287 let folds: Folds = json::from_str(folds).unwrap();

Callers

nothing calls this directly

Calls 1

processMethod · 0.80

Tested by

no test coverage detected