https://bugs.kde.org/show_bug.cgi?id=399348

            Bug ID: 399348
           Summary: Adding delimiters to "additionalDeliminator" sometimes
                    causes delimiters to stop being recognized
           Product: frameworks-syntax-highlighting
           Version: 5.50.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: syntax
          Assignee: kwrite-bugs-n...@kde.org
          Reporter: mrchristopherjac...@gmail.com
  Target Milestone: ---

Created attachment 115392
  --> https://bugs.kde.org/attachment.cgi?id=115392&action=edit
Minimal syntax highlighter for testing additionalDeliminator.

SUMMARY

There's some weirdness when the following characters are included as
"additionalDeliminator"s, such that keyword matching appears to break down in
some situations:

  - " (or ")
  - ' (or ')
  - `
  - @

The weird part is that the behavior of the `<keyword String=...` rule doesn't
appear to be consistent when "additionalDeliminator" contains one or more of
these values --- sometimes highlighting breaks, sometimes it doesn't. I've
attached a minimal syntax highlighting file to illustrate what's happening. And
here's the "test file" I'm using:

   keyword
   {keyword}
   `keyword`
   'keyword'

As an example, in the test definition file I attached, there are a few separate
lines defining some additional delimiters. All but one are commented out, but
by commenting each one in, you can see where things get a little weird:

  Case 1: additionalDeliminator=""

   The keyword is highlighted 2 out of 4 times, missing the keyword between
backticks and single quotes. Bummer, but we learned that we should include
these as additional delimiters.

  Case 2: additionalDeliminator="`" or additionalDeliminator="&apos;"

    The keyword is highlighted 3 out of 4 times. Expected.

  Case 3: additionalDeliminator="&apos;`"

    The keyword is highlighted only 3 of 4 times again. This time it's missing
the one between curly braces. Huh? How did we lose a delimiter?

  Case 4: additionalDeliminator="&apos;`{}"

    Same as case 3 (3 of 4 instances, highlighted). Even trying to add the
curly braces back, explicitly, doesn't fix the issue. Just in case, I also
tested that the order doesn't appear to matter here.

There's some other weird collisions that occur with the four characters I
listed above and other characters, but as far as I can tell, as long as these
four characters don't appear anywhere in the "additionalDeliminator" list, all
other characters appear to be working together as expected. That is, I can
include all non-identifier-like symbols easily reached on my American keyword
and not appearing in the list above, like so:

    `additionalDeliminator="!#$%&amp;()*+,./:;&lt;=&gt;?[\]^{|}~"`

and everything works as expected. Once a single quote gets in there, though:

    `additionalDeliminator="!#$%&amp;&apos;()*+,./:;&lt;=&gt;?[\]^{|}~"`

it breaks again.


SOFTWARE VERSIONS
(available in About System)
KDE Plasma Framework Version: 5.50.0
KDE Syntax-highlighting Framework Version: 5.50.0
Qt Version: 5.11.2

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to