Skip to content

Commit

Permalink
gap buffer p7
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacperacy committed Jun 16, 2024
1 parent 33ad134 commit 87aa10a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 1 addition & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ impl App {
let current_line = &mut self.content[self.cursor_position.y];

if current_line.len() > pos.x {
// TODO: fix
let new_line = current_line.split_off(pos.x);

self.insert_to_content(pos.y + 1, new_line);
Expand Down
1 change: 0 additions & 1 deletion src/gap_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ impl GapBuffer {
gap_end: new_capacity,
};

self.buffer.truncate(self.gap_start);
self.gap_end = self.buffer.len();

split_buffer
Expand Down

0 comments on commit 87aa10a

Please sign in to comment.