Page MenuHomePhabricator

Fix an issue where lines with more than one pattern match highlighted improperly in Diffusion
ClosedPublic

Authored by epriestley on Aug 2 2019, 4:42 PM.
Tags
None
Referenced Files
F19203975: D20695.id.diff
Tue, Dec 16, 6:32 PM
F19083019: D20695.diff
Tue, Dec 2, 12:29 PM
F19050654: D20695.id.diff
Thu, Nov 27, 8:36 PM
F18936321: D20695.diff
Nov 10 2025, 8:05 PM
F18887765: D20695.diff
Nov 7 2025, 6:29 AM
F18886961: D20695.id49358.diff
Nov 7 2025, 5:24 AM
F18823587: D20695.diff
Oct 23 2025, 12:35 PM
F18823033: D20695.diff
Oct 23 2025, 9:54 AM
Subscribers
None

Details

Summary

Ref T13339. If a search pattern matches more than once on a line, we currently render the line incorreclty, duplicating some of the text.

substr() is being called as though the third parameter was end_offset, but it's actually length. Correct the parameter.

Test Plan

Before:

Screen Shot 2019-08-02 at 9.40.04 AM.png (201×356 px, 12 KB)

After:

Screen Shot 2019-08-02 at 9.39.54 AM.png (191×349 px, 11 KB)

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Aug 2 2019, 4:43 PM
epriestley requested review of this revision.
This revision was automatically updated to reflect the committed changes.