fix(vim): properly delete last line

This commit is contained in:
Aram Drevekenin 2020-10-14 19:04:26 +02:00
parent cd5ddd1d29
commit dfcd3dda58
7 changed files with 7 additions and 7 deletions

View file

@ -1156,7 +1156,7 @@ impl vte::Perform for TerminalOutput {
let newlines = self.newline_indices.iter().rev(); let newlines = self.newline_indices.iter().rev();
let mut delete_until = self.characters.len(); let mut delete_until = self.characters.len();
for newline_index in newlines { for newline_index in newlines {
if newline_index < &self.cursor_position { if newline_index <= &self.cursor_position {
break; break;
} }
delete_until = *newline_index; delete_until = *newline_index;

View file

@ -28,5 +28,5 @@ expression: snapshot
21 line38 21 line38
22 line39 22 line39
NORMAL testfile.rs unix | utf-8 | rust 40% 17:1 NORMAL testfile.rs unix | utf-8 | rust 40% 17:1
"/tmp/testfile.rs" 42L, 285C
Bye from Mosaic!█ Bye from Mosaic!█

View file

@ -29,4 +29,4 @@ expression: snapshot
21 line38 21 line38
22 line39 22 line39
NORMAL testfile.rs unix | utf-8 | rust 40% 17:1 NORMAL testfile.rs unix | utf-8 | rust 40% 17:1
"/tmp/testfile.rs" 42L, 285C

View file

@ -28,5 +28,5 @@ expression: snapshot
2 line28 2 line28
3 line29 3 line29
NORMAL testfile.rs unix | utf-8 | rust 61% 26:1 NORMAL testfile.rs unix | utf-8 | rust 61% 26:1
"/tmp/testfile.rs" 42L, 285C
Bye from Mosaic!█ Bye from Mosaic!█

View file

@ -29,4 +29,4 @@ expression: snapshot
2 line28 2 line28
3 line29 3 line29
NORMAL testfile.rs unix | utf-8 | rust 61% 26:1 NORMAL testfile.rs unix | utf-8 | rust 61% 26:1
"/tmp/testfile.rs" 42L, 285C

View file

@ -28,5 +28,5 @@ expression: snapshot
2 line26 2 line26
3 line27 3 line27
NORMAL testfile.rs unix | utf-8 | rust 57% 24:1 NORMAL testfile.rs unix | utf-8 | rust 57% 24:1
"/tmp/testfile.rs" 42L, 285C
Bye from Mosaic!█ Bye from Mosaic!█

View file

@ -29,4 +29,4 @@ expression: snapshot
2 line26 2 line26
3 line27 3 line27
NORMAL testfile.rs unix | utf-8 | rust 57% 24:1 NORMAL testfile.rs unix | utf-8 | rust 57% 24:1
"/tmp/testfile.rs" 42L, 285C