docs: sort memos by updated_at in fzf-lua example#23
Merged
Conversation
Add table.sort on entries by updated_at (descending) in the fzf-lua memo listing example so memos appear most recently modified first.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the README’s fzf-lua integration example to show memos in a “most recently modified first” order.
Changes:
- Adds an optional
table.sortblock to sort memo picker entries byupdated_at(descending) in the README example.
| local entries = api.get_memos() | ||
| -- OPTION: Sort by last modified time (most recent first) | ||
| table.sort(entries, function(a, b) | ||
| return (a.updated_at or 0) > (b.updated_at or 0) |
There was a problem hiding this comment.
The api.get_memos() entries don’t include an updated_at field (they have value, text, ordinal, info, tags), so this sort block will effectively no-op and is misleading in the README. If the goal is “last modified”, compute it from the filepath (e.g., using vim.fn.getftime(entry.value) / vim.uv.fs_stat(entry.value).mtime) or update the API to expose an mtime field and document that instead.
Suggested change
| return (a.updated_at or 0) > (b.updated_at or 0) | |
| local a_mtime = vim.fn.getftime(a.value) | |
| local b_mtime = vim.fn.getftime(b.value) | |
| return a_mtime > b_mtime |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
table.sortbyupdated_at(descending) to the fzf-lua memo listing example in README so memos appear most recently modified first.Test plan
make testpasses (README is not compiled)🤖 Generated with Claude Code