Better handling of newlines in editor insert and delete
This commit is contained in:
parent
c5deb38cfe
commit
5cc64c77c1
5 changed files with 117 additions and 42 deletions
|
|
@ -690,7 +690,15 @@ impl Buffer {
|
|||
shaping,
|
||||
));
|
||||
}
|
||||
if self.lines.is_empty() {
|
||||
|
||||
// Ensure there is an ending line with no line ending
|
||||
if self
|
||||
.lines
|
||||
.last()
|
||||
.map(|line| line.ending())
|
||||
.unwrap_or(LineEnding::default())
|
||||
!= LineEnding::None
|
||||
{
|
||||
self.lines.push(BufferLine::new(
|
||||
"",
|
||||
LineEnding::None,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue