notepad-plus-plus / notepad-plus-plus/notepad-plus-plus

Incorrect highlighting for .properties files

Open
#10,913 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scintilla dependent
Dominant language
C++
Stars
29.4k
Forks
5.4k
PR merge metrics
No merged PRs in 30d

Description

Description of the Issue

If you put a backslash before a colon or equal sign in the key of a property in a .properties file, it doesn't recognize it as a literal colon or equal sign.

Steps to Reproduce the Issue
  1. Create a .properties file
  2. Write a line that says key\:abc=value and another that says key\=123:value
    example.properties.txt
Expected Behavior

The key highlighting in the first line should end on the equal sign and on the colon for the second line.

Actual Behavior

syntax_highlighting
The key hightlighting actually ends in the colon for the first line and in the equal sign for the second one, meaning it didn't escape the equal sign for the first line, nor the colon for the second line

Debug Information

Notepad++ v8.1.9.3 (64-bit)
Build time : Dec 6 2021 - 19:21:37
Path : C:\Program Files\Notepad++\notepad++.exe
Command Line : "C:\Users\Chicos\Desktop\example.properties"
Admin mode : OFF
Local Conf mode : OFF
Cloud Config : OFF
OS Name : Windows 8.1 Connected Single Language (64-bit)
OS Build : 9600.20174
Current ANSI codepage : 1252
Plugins : mimeTools.dll NppConverter.dll NppExport.dll

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the attached example.properties.txt and reproduce the two escaped-separator cases in Notepad++. Start by locating the .properties syntax-highlighting implementation or entry point. Done means the key highlighting ends at the unescaped separator in both examples, with the escaped colon or equal sign treated literally.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.