mirror of
https://github.com/zoriya/bubbles.git
synced 2026-08-05 04:36:07 +00:00
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:
co-authored by
Kujtim Hoxha
parent
696244a1d0
commit
a4c42b5791
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user