on main help sign in
fix(editor): better sorting of files when completing with / (#733)
39ede6eCarlos Alexandro Becker
internal/tui/components/chat/editor/editor.go+1
@@ -481,6 +481,7 @@ func (m *editorCmp) SetPosition(x, y int) tea.Cmd {
481
481
482func (m *editorCmp) startCompletions() tea.Msg {
482func (m *editorCmp) startCompletions() tea.Msg {
483 files, _, _ := fsext.ListDirectory(".", nil, 0)
483 files, _, _ := fsext.ListDirectory(".", nil, 0)
484+ slices.Sort(files)
484 completionItems := make([]completions.Completion, 0, len(files))
485 completionItems := make([]completions.Completion, 0, len(files))
485 for _, file := range files {
486 for _, file := range files {
486 file = strings.TrimPrefix(file, "./")
487 file = strings.TrimPrefix(file, "./")