Skip to content

Commit

Permalink
gap buffer p9
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacperacy committed Jun 18, 2024
1 parent 96fc4c0 commit 8f333ef
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,12 @@ impl App {
return;
}

while self.cursor_position.y >= self.content.len() {
let pos = self.get_cursor_position();

while pos.y >= self.content.len() {
self.push_to_content(GapBuffer::new(GAP_BUFFER_DEFAULT_SIZE));
}

let pos = self.get_cursor_position();
let current_line = &mut self.content[self.cursor_position.y];

if current_line.len() > pos.x {
Expand Down

0 comments on commit 8f333ef

Please sign in to comment.