Skip to content

Commit

Permalink
fix(developer): enable line breaks in debugger
Browse files Browse the repository at this point in the history
Fixes #9444.
  • Loading branch information
mcdurdin committed Oct 31, 2023
1 parent 68c1bcd commit 0d36fc0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion developer/src/tike/child/UfrmDebug.pas
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,16 @@ TMemoSelectionState = record
begin
Assert(m >= 1);
Assert(memo.Text[m] <> #$FFFC);
// Delete surrogate pairs
if (m > 1) and
Uni_IsSurrogate2(memo.Text[m]) and
Uni_IsSurrogate1(memo.Text[m-1]) then
Dec(m, 2)
// Delete \r\n line breaks
else if (m > 1) and
(memo.Text[m] = #$0A) and
(memo.Text[m-1] = #$0D) then
Dec(m, 2)
else
Dec(m);
end;
Expand Down Expand Up @@ -894,7 +900,8 @@ TMemoSelectionState = record
state: TMemoSelectionState;
begin
state := SaveMemoSelectionState;
memo.SelText := Text;
// Line breaks: replace \n with \r\n so line breaks work
memo.SelText := ReplaceStr(Text, #$0D, #$0D#$0A);
memo.SelStart := memo.SelStart + memo.SelLength; // I1603
memo.SelLength := 0;
RealignMemoSelectionState(state);
Expand Down

0 comments on commit 0d36fc0

Please sign in to comment.