feat(textarea): add focus status to setPromptFunc (#797)

* fix!(textarea): send focus status to promptFunc

* feat(filepicker): add highlighted file path

* chore: rename and add docs

* fix(filepicker): disabled cursor style

* feat(textarea): promptFunc receives a PromptInfo type with metadata

---------

Co-authored-by: Kujtim Hoxha <kujtimii.h@gmail.com>
This commit is contained in:
Christian Rocha
2025-07-10 12:19:07 -04:00
committed by GitHub
co-authored by Kujtim Hoxha
parent 696244a1d0
commit a4c42b5791
2 changed files with 22 additions and 4 deletions
+9 -1
View File
@@ -401,7 +401,7 @@ func (m Model) View() string {
selected += " → " + symlinkPath
}
if disabled {
s.WriteString(m.Styles.DisabledSelected.Render(m.Cursor) + m.Styles.DisabledSelected.Render(selected))
s.WriteString(m.Styles.DisabledCursor.Render(m.Cursor) + m.Styles.DisabledSelected.Render(selected))
} else {
s.WriteString(m.Styles.Cursor.Render(m.Cursor) + m.Styles.Selected.Render(selected))
}
@@ -516,3 +516,11 @@ func (m Model) canSelect(file string) bool {
}
return false
}
// HighlightedPath returns the path of the currently highlighted file or directory.
func (M Model) HighlightedPath() string {
if len(M.files) == 0 || M.selected < 0 || M.selected >= len(M.files) {
return ""
}
return filepath.Join(M.CurrentDirectory, M.files[M.selected].Name())
}