summaryrefslogtreecommitdiff
path: root/popups.go
diff options
context:
space:
mode:
authorGrail Finder <wohilas@gmail.com>2026-02-27 08:07:55 +0300
committerGrail Finder <wohilas@gmail.com>2026-02-27 08:07:55 +0300
commit0d947340904db30b3dce36f5ebd5230057da9f18 (patch)
treeba75552a324fb393ab46556d51770e9bad6897fc /popups.go
parenta0ff384b815f525bf15e6928e9a00b7019156e41 (diff)
Enha: tool role index for shellmode
Diffstat (limited to 'popups.go')
-rw-r--r--popups.go62
1 files changed, 0 insertions, 62 deletions
diff --git a/popups.go b/popups.go
index 84b13c4..22873d2 100644
--- a/popups.go
+++ b/popups.go
@@ -343,68 +343,6 @@ func showBotRoleSelectionPopup() {
app.SetFocus(roleListWidget)
}
-func showFileCompletionPopup(filter string) {
- baseDir := cfg.FilePickerDir
- if baseDir == "" {
- baseDir = "."
- }
- complMatches := scanFiles(baseDir, filter)
- if len(complMatches) == 0 {
- return
- }
- // If only one match, auto-complete without showing popup
- if len(complMatches) == 1 {
- currentText := textArea.GetText()
- atIdx := strings.LastIndex(currentText, "@")
- if atIdx >= 0 {
- before := currentText[:atIdx]
- textArea.SetText(before+complMatches[0], true)
- }
- return
- }
- widget := tview.NewList().ShowSecondaryText(false).
- SetSelectedBackgroundColor(tcell.ColorGray)
- widget.SetTitle("file completion").SetBorder(true)
- for _, m := range complMatches {
- widget.AddItem(m, "", 0, nil)
- }
- widget.SetSelectedFunc(func(index int, mainText string, secondaryText string, shortcut rune) {
- currentText := textArea.GetText()
- atIdx := strings.LastIndex(currentText, "@")
- if atIdx >= 0 {
- before := currentText[:atIdx]
- textArea.SetText(before+mainText, true)
- }
- pages.RemovePage("fileCompletionPopup")
- app.SetFocus(textArea)
- })
- widget.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
- if event.Key() == tcell.KeyEscape {
- pages.RemovePage("fileCompletionPopup")
- app.SetFocus(textArea)
- return nil
- }
- if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
- pages.RemovePage("fileCompletionPopup")
- app.SetFocus(textArea)
- return nil
- }
- return event
- })
- modal := func(p tview.Primitive, width, height int) tview.Primitive {
- return tview.NewFlex().
- AddItem(nil, 0, 1, false).
- AddItem(tview.NewFlex().SetDirection(tview.FlexRow).
- AddItem(nil, 0, 1, false).
- AddItem(p, height, 1, true).
- AddItem(nil, 0, 1, false), width, 1, true).
- AddItem(nil, 0, 1, false)
- }
- // Add modal page and make it visible
- pages.AddPage("fileCompletionPopup", modal(widget, 80, 20), true, true)
- app.SetFocus(widget)
-}
-
func showShellFileCompletionPopup(filter string) {
baseDir := cfg.FilePickerDir
if baseDir == "" {