summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorPhil Jones <philj56@gmail.com>2022-07-05 11:03:58 +0100
committerPhil Jones <philj56@gmail.com>2022-07-05 11:03:58 +0100
commitcff85b9a55c7d3f08de9ef9272b97d7fa6212302 (patch)
tree5d0d9b147ec2f2ec63a86f0e26fceee9e03c8452 /src/main.c
parente062dc7ca2bb70561b11674428939057832158a9 (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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 307be0e..96140f5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;