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

Method delete_char_forward

src/editor/buffer.rs:223–243  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

221 }
222
223 pub fn delete_char_forward(&mut self) {
224 if self.delete_selection() {
225 return;
226 }
227 let char_idx = self.cursor_char_idx();
228 if char_idx >= self.document.len_chars() {
229 return;
230 }
231
232 let cursor_before = self.cursor;
233 let end = self.document.next_grapheme_boundary(char_idx);
234 let deleted = self.document.slice_text(char_idx, end);
235 self.document.remove_char_range(char_idx, end);
236 self.cursor.clamp_to_document(&self.document);
237 self.push_undo(UndoRecord {
238 start: char_idx,
239 inserted: String::new(),
240 deleted,
241 cursor_before,
242 });
243 }
244
245 pub fn delete_char_backward(&mut self) {
246 if self.delete_selection() {

Callers 3

handle_editor_keyMethod · 0.80
apply_editor_keyFunction · 0.80

Calls 8

delete_selectionMethod · 0.80
cursor_char_idxMethod · 0.80
len_charsMethod · 0.80
slice_textMethod · 0.80
remove_char_rangeMethod · 0.80
clamp_to_documentMethod · 0.80
push_undoMethod · 0.80

Tested by 1