Skip to content

Commit 82f9b0e

Browse files
Robert Di PardoRobert Di Pardo
authored andcommitted
Fix JS decoding of multiline sequences
The previous logic updated the selection's end position at every pass, which tended to miss codes at line ends (especially if a final newline was absent); e.g. \u274C\u2705\u274C\u2705\u274C\u2705\u274C\u2705\u274C\u2705 \u274C\u2705\u274C\u2705 \u274C\u2705 \u274C decoded as ❌✅❌✅❌✅❌✅❌✅ ❌✅❌✅ ❌\u2705 \u274C An integer overflow exception when encoding 4-byte glyphs like 🍪 was quietly fixed in ad2e69c. More work still needed before utf8mb4 can be encoded *correctly*
1 parent 1ff61a7 commit 82f9b0e

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

src/U_JSEncode.pas

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ function DecodeJS(Scope: TEntityReplacementScope = ersSelection): Integer;
119119
if Assigned(Match) then begin
120120
// Adjust the target already
121121
Target.StartPos := Match.StartPos + 1;
122-
Target.EndPos := Target.EndPos - Length(Match.Text) + 2;
123122

124123
// replace this match's text by the appropriate Unicode character
125124
Match.Text := Char(StrToInt('$' + Copy(Match.Text, 3, 4)));

0 commit comments

Comments
 (0)