Skip to content

Commit

Permalink
Map new python "attribute" mapping to identifier_2, by default.
Browse files Browse the repository at this point in the history
"attribute" is for highlighting object attributes or methods, i.e.
to style foo and bar differently in foo.bar.

Also set lexer properties to allow scintilla using different styles.

See ScintillaOrg/lexilla#49
  • Loading branch information
kugel- committed Oct 4, 2023
1 parent 19336d2 commit 9aa597e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions data/filedefs/filetypes.python.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fstring=string_1
fcharacter=character
ftriple=string_2
ftripledouble=string_2
attribute=identifier_1

[keywords]
# all items must be in one line
Expand All @@ -34,6 +35,8 @@ identifiers=ArithmeticError AssertionError AttributeError BaseException Blocking
[lexer_properties]
fold.quotes.python=1
lexer.python.keywords2.no.sub.identifiers=1
lexer.python.identifier.attributes=1
lexer.python.identifier.decorator=1

[settings]
# default extension used when saving files
Expand Down
3 changes: 2 additions & 1 deletion src/highlightingmappings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,8 @@ static const HLStyle highlighting_styles_PYTHON[] =
{ SCE_P_FCHARACTER, "fcharacter", FALSE },
{ SCE_P_FTRIPLE, "ftriple", FALSE },
{ SCE_P_FTRIPLEDOUBLE, "ftripledouble", FALSE },
{ SCE_P_DECORATOR, "decorator", FALSE }
{ SCE_P_DECORATOR, "decorator", FALSE },
{ SCE_P_ATTRIBUTE, "attribute", FALSE }
};
static const HLKeyword highlighting_keywords_PYTHON[] =
{
Expand Down

0 comments on commit 9aa597e

Please sign in to comment.