Skip to main content

mq_edit/editor/
editing.rs

1use crate::document::DocumentBuffer;
2
3/// Editing operations for the document buffer
4pub struct EditingOperations;
5
6impl EditingOperations {
7    /// Insert character at current cursor position
8    pub fn insert_char(buffer: &mut DocumentBuffer, c: char) {
9        buffer.insert_char(c);
10    }
11
12    /// Delete character before cursor (backspace)
13    pub fn delete_char(buffer: &mut DocumentBuffer) {
14        buffer.delete_char();
15    }
16
17    /// Insert newline at cursor
18    pub fn insert_newline(buffer: &mut DocumentBuffer) {
19        buffer.insert_newline();
20    }
21}