Skip to content

Commit

Permalink
Let the user configure unicode & error syntax highlight colors
Browse files Browse the repository at this point in the history
  • Loading branch information
zas committed May 26, 2024
1 parent dfc1ea9 commit 4acf120
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
24 changes: 15 additions & 9 deletions picard/ui/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ class UnknownColorException(Exception):
'tagstatus_added': N_("Tag added"),
'tagstatus_changed': N_("Tag changed"),
'tagstatus_removed': N_("Tag removed"),
'syntax_hl_func': N_("Function syntax highlight"),
'syntax_hl_var': N_("Variable syntax highlight"),
'syntax_hl_error': N_("Error syntax highlight"),
'syntax_hl_escape': N_("Escape syntax highlight"),
'syntax_hl_special': N_("Special syntax highlight"),
'syntax_hl_func': N_("Function syntax highlight"),
'syntax_hl_noop': N_("Noop syntax highlight"),
'syntax_hl_special': N_("Special syntax highlight"),
'syntax_hl_unicode': N_("Unicode syntax highlight"),
'syntax_hl_var': N_("Variable syntax highlight"),
}


Expand Down Expand Up @@ -103,16 +105,20 @@ def register_color(themes, name, value):
register_color(_DARK, 'first_cover_hl', 'orange')

# syntax highlighting colors
register_color(_LIGHT, 'syntax_hl_func', 'blue'),
register_color(_LIGHT, 'syntax_hl_var', 'darkCyan'),
register_color(_LIGHT, 'syntax_hl_error', 'blue'),

Check warning on line 108 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L108

Expression "(register_color(_LIGHT, 'syntax_hl_error', 'blue'), )" is assigned to nothing

Check notice on line 108 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L108

Expression "(register_color(_LIGHT, 'syntax_hl_error', 'blue'), )" is assigned to nothing (expression-not-assigned)
register_color(_LIGHT, 'syntax_hl_escape', 'darkRed'),

Check warning on line 109 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L109

Expression "(register_color(_LIGHT, 'syntax_hl_escape', 'darkRed'), )" is assigned to nothing

Check notice on line 109 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L109

Expression "(register_color(_LIGHT, 'syntax_hl_escape', 'darkRed'), )" is assigned to nothing (expression-not-assigned)
register_color(_LIGHT, 'syntax_hl_special', 'blue'),
register_color(_LIGHT, 'syntax_hl_func', 'blue'),

Check warning on line 110 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L110

Expression "(register_color(_LIGHT, 'syntax_hl_func', 'blue'), )" is assigned to nothing
register_color(_LIGHT, 'syntax_hl_noop', 'darkGray'),

Check warning on line 111 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L111

Expression "(register_color(_LIGHT, 'syntax_hl_noop', 'darkGray'), )" is assigned to nothing

Check notice on line 111 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L111

Expression "(register_color(_LIGHT, 'syntax_hl_noop', 'darkGray'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_func', '#FF57A0'),
register_color(_DARK, 'syntax_hl_var', '#FCBB51'),
register_color(_LIGHT, 'syntax_hl_special', 'blue'),

Check warning on line 112 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L112

Expression "(register_color(_LIGHT, 'syntax_hl_special', 'blue'), )" is assigned to nothing

Check notice on line 112 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L112

Expression "(register_color(_LIGHT, 'syntax_hl_special', 'blue'), )" is assigned to nothing (expression-not-assigned)
register_color(_LIGHT, 'syntax_hl_unicode', 'darkRed'),

Check warning on line 113 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L113

Expression "(register_color(_LIGHT, 'syntax_hl_unicode', 'darkRed'), )" is assigned to nothing

Check notice on line 113 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L113

Expression "(register_color(_LIGHT, 'syntax_hl_unicode', 'darkRed'), )" is assigned to nothing (expression-not-assigned)
register_color(_LIGHT, 'syntax_hl_var', 'darkCyan'),

Check warning on line 114 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L114

Expression "(register_color(_LIGHT, 'syntax_hl_var', 'darkCyan'), )" is assigned to nothing

Check notice on line 114 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L114

Expression "(register_color(_LIGHT, 'syntax_hl_var', 'darkCyan'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_error', '#FF57A0'),

Check warning on line 115 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L115

Expression "(register_color(_DARK, 'syntax_hl_error', '#FF57A0'), )" is assigned to nothing

Check notice on line 115 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L115

Expression "(register_color(_DARK, 'syntax_hl_error', '#FF57A0'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_escape', '#4BEF1F'),

Check warning on line 116 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L116

Expression "(register_color(_DARK, 'syntax_hl_escape', '#4BEF1F'), )" is assigned to nothing
register_color(_DARK, 'syntax_hl_special', '#FF57A0'),
register_color(_DARK, 'syntax_hl_func', '#FF57A0'),

Check warning on line 117 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L117

Expression "(register_color(_DARK, 'syntax_hl_func', '#FF57A0'), )" is assigned to nothing

Check notice on line 117 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L117

Expression "(register_color(_DARK, 'syntax_hl_func', '#FF57A0'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_noop', '#04E7D5'),

Check warning on line 118 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L118

Expression "(register_color(_DARK, 'syntax_hl_noop', '#04E7D5'), )" is assigned to nothing

Check notice on line 118 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L118

Expression "(register_color(_DARK, 'syntax_hl_noop', '#04E7D5'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_special', '#FF57A0'),

Check warning on line 119 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L119

Expression "(register_color(_DARK, 'syntax_hl_special', '#FF57A0'), )" is assigned to nothing

Check notice on line 119 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L119

Expression "(register_color(_DARK, 'syntax_hl_special', '#FF57A0'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_unicode', '#4BEF1F'),

Check notice on line 120 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L120

Expression "(register_color(_DARK, 'syntax_hl_unicode', '#4BEF1F'), )" is assigned to nothing (expression-not-assigned)
register_color(_DARK, 'syntax_hl_var', '#FCBB51'),

Check warning on line 121 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L121

Expression "(register_color(_DARK, 'syntax_hl_var', '#FCBB51'), )" is assigned to nothing

Check notice on line 121 in picard/ui/colors.py

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

picard/ui/colors.py#L121

Expression "(register_color(_DARK, 'syntax_hl_var', '#FCBB51'), )" is assigned to nothing (expression-not-assigned)


class InterfaceColors:
Expand Down
2 changes: 1 addition & 1 deletion picard/ui/widgets/scripttextedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def __init__(self, document):
'noop': HighlightFormat(fg_color='syntax_hl_noop', bold=True, italic=True),
'special': HighlightFormat(fg_color='syntax_hl_special'),
'unicode': HighlightFormat(fg_color='syntax_hl_escape', italic=True),
'unknown_func': HighlightFormat(fg_color='syntax_hl_special', italic=True),
'unknown_func': HighlightFormat(fg_color='syntax_hl_error', italic=True),
'var': HighlightFormat(fg_color='syntax_hl_var'),
}

Expand Down

0 comments on commit 4acf120

Please sign in to comment.