fork-dev / Tracker

Bug and issue tracker for Fork for Mac
498 stars 12 forks source link

Diff viewer text colour coding chokes on RegEx #1977

Open frandroid opened 10 months ago

frandroid commented 10 months ago
Screenshot 2023-09-28 at 18 25 10
const handleSearch = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
    if (searchRef.current) {
      searchRef.current.value = searchRef.current.value.replace(/[\t\n\r"#$%&()*+,/:;<=>?@[\\^`{|}~]/g, "");
    }
    debouncedSearch(event.target.value);
  };

When looking at a diff that contains this code, the text goes blue on the slash after "replace(", and then it stays blue for the rest of the file. Except when highlighting text in strings, for which the text flips back to black, in a reverse of the main pattern.

Screenshot 2023-09-28 at 18 28 50

Thanks for the work you do on Fork!