Skip to content

Commit

Permalink
properly deal with trailing newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
dk committed Aug 4, 2024
1 parent a5a81c7 commit 048c991
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Prima/Edit.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ sub set_text_ref
$self-> {capLen} = length( $$ref) || 0;
$#{$self-> {lines}} = $self-> {capLen} / 40;
@{$self-> {lines}} = ();
@{$self-> {lines}} = split( "\n", $$ref // '');
@{$self-> {lines}} = split( "\n", $$ref // '', -1);
$self-> {maxLine} = scalar @{$self-> {lines}} - 1;
$self-> reset_shaping_caches;
$self-> reset_syntax;
Expand Down Expand Up @@ -2699,7 +2699,7 @@ sub copy_block
$self-> lock_change(0);
$self-> lock;
$self-> begin_undo_group;
my @lines = split "\n", $self->get_selected_text;
my @lines = split "\n", $self->get_selected_text, -1;
if ( $self-> {blockType} == bt::Horizontal) {
$self-> insert_line( $self-> cursorY, @lines);
} else {
Expand Down Expand Up @@ -2735,7 +2735,7 @@ sub overtype_block
$self-> lock_change(0);
$self-> lock;
$self-> begin_undo_group;
my @lines = split "\n", $self->get_selected_text;
my @lines = split "\n", $self->get_selected_text, -1;
my @cs = $self-> cursor;
if ( $self-> {blockType} == bt::Horizontal) {
for ( my $i = $cs[1]; $i < $cs[1] + scalar @lines; $i++) {
Expand Down

0 comments on commit 048c991

Please sign in to comment.