MCPcopy
hub / github.com/SurgeDM/Surge / applyFilePickerMode

Method applyFilePickerMode

internal/tui/helpers.go:132–143  ·  view source on GitHub ↗
(fileAllowed, dirAllowed bool)

Source from the content-addressed store, hash-verified

130}
131
132func (m *RootModel) applyFilePickerMode(fileAllowed, dirAllowed bool) {
133 m.filepicker.FileAllowed = fileAllowed
134 m.filepicker.DirAllowed = dirAllowed
135
136 if fileAllowed {
137 m.filepicker.KeyMap.Select = key.NewBinding(key.WithKeys(".", "enter"))
138 m.filepicker.KeyMap.Open = key.NewBinding(key.WithKeys(".", "enter", "right"))
139 } else {
140 m.filepicker.KeyMap.Select = key.NewBinding(key.WithKeys("."))
141 m.filepicker.KeyMap.Open = key.NewBinding(key.WithKeys(".", "right"))
142 }
143}
144
145func (m *RootModel) openDirectoryPicker(origin FilePickerOrigin, originalPath, browseDir string, fileAllowed, dirAllowed bool) tea.Cmd {
146 m.filepickerOrigin = origin

Callers 4

openDirectoryPickerMethod · 0.95
updateFilePickerMethod · 0.95
updateBatchFilePickerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected