mrtazz/simplenote.vim — pull request #38 by atomicules (2012-11-21 16:05:18+00:00)
Title: :Simplenote -l X doesn't work well when there are deleted notes

You can assign this one to me.

Previously doing something like `:Simplenote -l 10` worked really well for me and returned the 10 most recent notes. However, now by limiting the number of notes fetched to 10 I will end up with just one note being listed in Vim (because the other 9 fetched will have the "deleted" flag set). I don't know if it is because something has changed in the API or whether it's because I've more deleted notes.

I thought the API returned the note index starting with the most recent note? I'm sure that is how it worked when I added in the "limit list" bit. However, now it seems to return the oldest note first and since a lot of my older notes are more likely to have the "deleted" flag set that's why I end up with one note, etc being displayed. The only API doc I've got access to is v2.1.5. Do you know if there have been any changes since this?

The [limit list functionality in Simplenote.py](https://github.com/mrtazz/simplenote.py/commit/4721cb9cc275294465de9e13a4bf92527042b75c) works, but the problem with how I implemented it in Simplenote.vim is that I did not appreciate or take into account that Simplenote.vim [filters the returned list for display](https://github.com/mrtazz/simplenote.vim/blob/master/autoload/simplenote.vim#L588-L589).

So... there are two problems

1. I need to rethink how it works. I guess I just for each fetch of notes I just need to count how many aren't deleted and continue fetching until enough undeleted notes are retrieved. But...
2. This doesn't help with the fact that the api now seems to be returning results in reverse order. I don't really care for my oldest 10 notes :-(.

Perhaps I'd be better scrapping the "limit list" idea and using the "modified since" option in the API for a way of limiting the notes returned?