Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-work sorting of notes in list index
This somewhat goes all the back to commit: 729f151 where I somewhat lazily made Python 3 compatible by using the `cmp_to_key` function. Finally getting around to looking into #97 I realised the only way to fix that issue was moving the sorting to an iterative based approach where, say if we are sorting on "pinned, tags, modifydate", we first sort the notes on modifydate, then go through them again and sort on tags and finally on the primary key of pinned. The `cmp_to_key` based function can't do this as it's only really doing a single iteration through the notes, but trying to check all the criteria (by iterating through the criteria) at once. This is why we ended up with little groups within tags sorted by modified date. Anyway, as a result of all this it's actually a lot simpler. - Sort by tag is purely on existence of tags now (no alpha sort or number of tags sort) - We are sorting tags within a note by alpha for display purposes; This should be moved to Simplenote.py I've probably not explained any of that well. Fixes: #97
- Loading branch information
1 parent
30f48f7
commit 29d52cc
Showing
1 changed file
with
21 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29d52cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: you'll want to move that "sort tags alphabetically" bit into the status check block, because if a note couldn't be retrieved from the SimpleNote server, assuming that the "tags" field is present will cause Vim to hang as a result of that unhandled KeyError. (For some reason there's a nonexistent note in my account that constantly returns 404 Not Found any time one tries to retrieve the note itself that nonetheless shows up in listings, so I was getting hangs every time I tried to do a note listing that included said note.)
29d52cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drat... thanks for letting me know... I'll try to do what I've said todo and move that to simplenote.py soon.
29d52cc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Viqsi Should be fixed now. Hopefully. Sorry about that.