MCPcopy Create free account
hub / github.com/Eeive/Evcode-ide / open_file

Method open_file

src/editor/mod.rs:109–120  ·  view source on GitHub ↗
(&mut self, path: &str)

Source from the content-addressed store, hash-verified

107 }
108
109 pub fn open_file(&mut self, path: &str) -> Result<()> {
110 for (i, f) in self.files.iter().enumerate() {
111 if f.path.as_deref() == Some(path) {
112 self.current_file = i;
113 return Ok(());
114 }
115 }
116 let file = OpenFile::from_path(path)?;
117 self.files.push(file);
118 self.current_file = self.files.len() - 1;
119 Ok(())
120 }
121
122 pub fn save_current(&mut self) -> Result<()> {
123 if let Some(f) = self.files.get_mut(self.current_file) {

Callers 5

handle_mouseMethod · 0.80
handle_file_tree_keyMethod · 0.80
handle_teleport_keyMethod · 0.80
handle_naming_keyMethod · 0.80
restore_sessionMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected