Skip to content

Commit

Permalink
feat(nr): add sorting configuration option to Fzf (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
levelio authored Nov 14, 2024
1 parent acb0f7a commit 2c544a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/commands/nr.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import process from 'node:process'
import type { Choice } from '@posva/prompts'
import prompts from '@posva/prompts'
import { Fzf } from 'fzf'
import { Fzf, byLengthAsc } from 'fzf'
import { dump, load } from '../storage'
import { parseNr } from '../parse'
import { getPackageJSON } from '../fs'
Expand Down Expand Up @@ -54,6 +54,7 @@ runCli(async (agent, args, ctx) => {
const fzf = new Fzf(raw, {
selector: item => `${item.key} ${item.description}`,
casing: 'case-insensitive',
tiebreakers: [byLengthAsc],
})

if (storage.lastRunCommand) {
Expand Down

0 comments on commit 2c544a6

Please sign in to comment.