Skip to content

Commit

Permalink
feat(path): sort directories first, then by name lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
Saghen committed Dec 21, 2024
1 parent 4218120 commit 400de65
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lua/blink/cmp/sources/path/lib.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ function lib.entry_to_completion_item(context, entry, dirname, opts)
kind = is_dir and CompletionItemKind.Folder or CompletionItemKind.File,
insertText = insert_text,
textEdit = lib.get_text_edit(context, insert_text),
sortText = (is_dir and '1' or '2') .. entry.name:lower(), -- Sort directories before files
word = opts.trailing_slash and entry.name or nil,
data = { path = entry.name, full_path = dirname .. '/' .. entry.name, type = entry.type, stat = entry.stat },
}
Expand Down

0 comments on commit 400de65

Please sign in to comment.