Skip to content

Commit

Permalink
Merge pull request #9906 from keymanapp/fix/developer/9444-line-break…
Browse files Browse the repository at this point in the history
…s-in-debugger

fix(developer): enable line breaks in debugger
  • Loading branch information
mcdurdin authored Nov 2, 2023
2 parents 38d2c92 + e2ecf57 commit a1c1658
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 \r (0x0D) with \r\n (0x0D 0x0A) 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 a1c1658

Please sign in to comment.