summaryrefslogtreecommitdiff
path: root/alot/helper.py
diff options
context:
space:
mode:
authorKazuo Teramoto <kaz.rag@gmail.com>2012-07-25 13:16:55 -0300
committerKazuo Teramoto <kaz.rag@gmail.com>2012-07-25 13:16:55 -0300
commit49043c46a03724b00fa673e2250eb8dd27c2891a (patch)
treee8cee66529b8eb27a12d937df2f163dc0f555baf /alot/helper.py
parent2d47963053378cac1508beda8a87929efd7b670f (diff)
Fix the sorting of tags with length == 1
The tag sorting `cmp()` put single unicode tags before the long tag names, but don't sort the single length tags. This commit fix this behavior sorting the single length tags separately.
Diffstat (limited to 'alot/helper.py')
-rw-r--r--alot/helper.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/helper.py b/alot/helper.py
index 78744edf..3e5e9dce 100644
--- a/alot/helper.py
+++ b/alot/helper.py
@@ -418,7 +418,7 @@ def tag_cmp(a, b):
Sorting tags using this function puts all tags of length 1 at the
beginning. This groups all tags mapped to unicode characters.
'''
- if min(len(a), len(b)) == 1:
+ if min(len(a), len(b)) == 1 and max(len(a), len(b)) > 1:
return cmp(len(a), len(b))
else:
return cmp(a.lower(), b.lower())