diff options
author | Phil Jones <philj56@gmail.com> | 2022-07-05 11:03:58 +0100 |
---|---|---|
committer | Phil Jones <philj56@gmail.com> | 2022-07-05 11:03:58 +0100 |
commit | cff85b9a55c7d3f08de9ef9272b97d7fa6212302 (patch) | |
tree | 5d0d9b147ec2f2ec63a86f0e26fceee9e03c8452 /src/main.c | |
parent | e062dc7ca2bb70561b11674428939057832158a9 (diff) |
Sort results by match position.
Search results will now be sorted by history first, then by the position
of the match, such that a match at the start of a result will appear
before a match later in the result.
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1187,11 +1187,11 @@ int main(int argc, char *argv[]) tofi.submit = false; if (tofi.window.entry.results.count > 0) { uint32_t selection = tofi.window.entry.selection; - printf("%s\n", tofi.window.entry.results.buf[selection]); + printf("%s\n", tofi.window.entry.results.buf[selection].string); if (tofi.use_history) { history_add( &tofi.window.entry.history, - tofi.window.entry.results.buf[selection]); + tofi.window.entry.results.buf[selection].string); history_save(&tofi.window.entry.history); } break; |