Skip to content

Commit

Permalink
Refactor cut_line
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Nov 29, 2024
1 parent 5d8605c commit d549a6d
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/usr/edit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -613,16 +613,7 @@ impl Editor {
if self.lines.is_empty() {
self.lines.push(String::new());
}
if i >= self.lines.len() { // Move cursor up to the previous line
if self.cursor.y > 0 {
self.cursor.y -= 1;
} else if self.offset.y > 0 {
self.offset.y -= 1;
}
}
self.cursor.x = 0;
self.offset.x = 0;
self.print_screen();
self.handle_arrow_up(); // Move cursor to previous line
}

fn copy_line(&mut self) {
Expand Down

0 comments on commit d549a6d

Please sign in to comment.