summaryrefslogtreecommitdiff
path: root/alot/settings
diff options
context:
space:
mode:
authorJulian Mehne <julian.mehne@posteo.de>2017-12-01 15:22:01 +0100
committerJulian Mehne <julian.mehne@posteo.de>2017-12-02 00:19:37 +0100
commitf89555064a810ad7fcb3cbe079639ac3f83ff07c (patch)
tree0e362e56dcf164374693079234610e6c4106f50b /alot/settings
parent054d2a932e7cb8d18dae258750ed26fb86e650b9 (diff)
Allow regex special characters in tagstrings.
Fixes the following crashes: 1. tag completion with regex special chars :search tag:[<tab> 2. Changing tag representation of an (existing) tag with regex special chars: [tags] [[my**tag]] normal = '','', 'white','light red', 'white','#d66' 3. Contact completion with regex special chars and no external command: To:**foo<tab>
Diffstat (limited to 'alot/settings')
-rw-r--r--alot/settings/manager.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/settings/manager.py b/alot/settings/manager.py
index c71fba42..98d534fb 100644
--- a/alot/settings/manager.py
+++ b/alot/settings/manager.py
@@ -320,7 +320,7 @@ class SettingsManager(object):
fallback_focus = resolve_att(onebelow_focus, default_focus)
for sec in cfg['tags'].sections:
- if re.match('^' + sec + '$', tag):
+ if re.match('^{}$'.format(re.escape(sec)), tag):
normal = resolve_att(colourpick(cfg['tags'][sec]['normal']),
fallback_normal)
focus = resolve_att(colourpick(cfg['tags'][sec]['focus']),