Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect highlight python decorator #5894

Closed
PavelBlend opened this issue Jul 6, 2019 · 6 comments
Closed

Incorrect highlight python decorator #5894

PavelBlend opened this issue Jul 6, 2019 · 6 comments
Assignees

Comments

@PavelBlend
Copy link
Contributor

Description of the Issue

The decorator color is not yellow if it contains a dot.

Steps to Reproduce the Issue

Paste this code into Notepad ++ 7.7.1 32 bit:

import test_module


@test_module.test_decorator
def test_function():
    pass

Expected Behavior

The entire decorator should be yellow.

Actual Behavior

decorator_color_test

@Ekopalypse
Copy link
Contributor

npp uses scintilla as its core lexing component and therefore issue needs to be reported here.
From my limited understanding it seems the issue is here.
If I replace this with if (!IsAWordChar(sc.ch, options.unicodeIdentifiers)) { then it seems to work.

@PavelBlend
Copy link
Contributor Author

Created a task:
https://sourceforge.net/p/scintilla/bugs/2139/

@dail8859 dail8859 added the scintilla dependent Can't be considered for N++ implementation unless/until Scintilla changes label Dec 24, 2021
@PavelBlend
Copy link
Contributor Author

I wrote an issue to lexilla and got the following response:
ScintillaOrg/lexilla#219 (comment)

Is it possible to fix this in Notepad++?

@donho donho added bug accepted and removed scintilla dependent Can't be considered for N++ implementation unless/until Scintilla changes labels Dec 23, 2023
@donho donho closed this as completed in d1b3fe6 Dec 23, 2023
@PavelBlend
Copy link
Contributor Author

PavelBlend commented Mar 5, 2024

@donho It seems there are new problems with the decorator.

Class method decorators have the wrong color:
01

Notepad++ v8.6.2 win 64 bit

@rdipardo
Copy link
Contributor

rdipardo commented Mar 5, 2024

@PavelBlend

Like I tried to explain before, there are two different lexer properties to configure.

The function decorator is in the SCE_P_DECORATOR state (id=15), which already has a style associated with it by the default Notepad++ theme.

The method decorator is in the SCE_P_ATTRIBUTE state (id=20), which does not yet have any style associated with it.

Here's how it should look in SciTE with both options configured:

; %UserProfile%\SciTEUser.properties

lexer.python.decorator.attributes=1
lexer.python.identifier.attributes=1

; decorator style
style.python.15=fore:#FF8000,italics,bold

; attribute style
style.python.20=fore:#CD0000,italics,bold,underlined

npp-gh-issue-5894-gscite-542

@donho donho reopened this Mar 5, 2024
@donho donho assigned donho and unassigned PavelBlend Mar 5, 2024
donho added a commit to donho/notepad-plus-plus that referenced this issue Mar 5, 2024
Add "ATTRIBUTE" color in Python.

Only DarkModeDefault.xml & Zenburn.xml are modified due to the other themes missing "DECORATOR" color with which "ATTRIBUTE" color uses.
I let people who use those themes and need "DECORATOR" & "ATTRIBUTE" colors to modify them.

Fix notepad-plus-plus#5894
@donho donho closed this as completed in b3ff400 Mar 5, 2024
@PavelBlend
Copy link
Contributor Author

PavelBlend commented Apr 5, 2024

@donho I expected different behavior. I have a standard theme. Decorators look like this:
01



I added a new ATTRIBUTES color to the stylers.xml file. This is the result:
02



I would like to have such a result:
2



Is it possible to specify the color of decorator attributes separately from other attributes?



I want to get the same result as functions:
01

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants