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

Method delete_line

src/editor/document.rs:180–192  ·  view source on GitHub ↗
(&mut self, line: usize)

Source from the content-addressed store, hash-verified

178 }
179
180 pub fn delete_line(&mut self, line: usize) {
181 if line >= self.line_count() {
182 return;
183 }
184
185 let start = self.rope.line_to_char(line);
186 let end = if line + 1 < self.line_count() {
187 self.rope.line_to_char(line + 1)
188 } else {
189 self.len_chars()
190 };
191 self.remove_char_range(start, end);
192 }
193
194 pub fn slice_text(&self, start: usize, end: usize) -> String {
195 let start = start.min(self.len_chars());

Callers

nothing calls this directly

Calls 4

line_to_charMethod · 0.80
len_charsMethod · 0.80
remove_char_rangeMethod · 0.80
line_countMethod · 0.45

Tested by

no test coverage detected