From 84230a6828023bc17a807df68a51f8eb5c807831 Mon Sep 17 00:00:00 2001 From: Glenn Date: Fri, 24 Nov 2023 10:49:32 +0100 Subject: [PATCH] feat: sort by fs.name instead of fs.type --- src/cli.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cli.cr b/src/cli.cr index 327fc92..6763a1d 100644 --- a/src/cli.cr +++ b/src/cli.cr @@ -173,7 +173,9 @@ module GX } end - result_filesystem_name = Fzf.run(names_display.values.map(&.[:ansi_name]).sort).strip + ## FIXME: feat: allow to sort by name or by filesystem + sorted_values = names_display.values.sort_by { |item| item[:filesystem].name } + result_filesystem_name = Fzf.run(sorted_values.map(&.[:ansi_name])).strip selected_filesystem = names_display[result_filesystem_name][:filesystem] puts ">> #{selected_filesystem.name}".colorize(:yellow)