notepad-plus-plus / notepad-plus-plus/notepad-plus-plus
UDL Bug: Escaping Behavior for the Operators1 Group not as Expected
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 29.4k
- Forks
- 5.4k
- PR merge metrics
- No merged PRs in 30d
Description
Description of the Issue
If having an "operator" in the Operators1 group that starts with the same character as the defined escape character for one or more Delimiters groups, escaping is NOT working as expected.
Steps to Reproduce the Issue
- Define an escape character, e.g. a ` (backtick, the escape character in PowerShell), to one or more of the (defined) Delimiters groups. In the Delimiter's Styler Dialog make sure the Operators1 box is ticked. Also make sure there are different color settings for the Delimiter and Operators1 groups.
- To the Operators1 Group add a multi-character "operator" that starts with the same character as the escape character, e.g. `n (the newline character in PowerShell).
- Surround the "operator" with the delimiters, e.g. "`n" or "`nSomeText" in a script file that supports the defined UDL.
Expected Behavior
The expected behavior would be for the `n character to NOT be escaped i.e not highlighted in the color of the delimiter.
Actual Behavior
The `n operator IS escaped and highlighted in the delimiter color. That behavior would only be expected if one more backtick was preceding, like in "``n" or "``nSomeText"
The bug is NOT present in any of the Keywords groups or the Operator2 group, where escaping behavior is as expected.
Debug Information
Notepad++ v7.9.5 (64-bit)
Build time : Mar 21 2021 - 02:13:17
Path : C:\Program Files\Notepad++\notepad++.exe
Admin mode : OFF
Local Conf mode : OFF
OS Name : Windows 10 Pro (64-bit)
OS Version : 2009
OS Build : 19042.985
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the UDL case in Notepad++ using a Delimiters group with escaping enabled and an Operators1 entry such as `n, then compare its highlighting with Keywords and Operators2. Trace the syntax-highlighting path for delimiter escaping and Operators1 matching; done means the operator is not escaped unless an additional escape character precedes it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100