diff options
| author | Grail Finder <wohilas@gmail.com> | 2026-02-19 08:35:21 +0300 |
|---|---|---|
| committer | Grail Finder <wohilas@gmail.com> | 2026-02-19 08:35:21 +0300 |
| commit | b18d96ac13539bd18e891bb8b6c934910d36800f (patch) | |
| tree | ce2ceba55185c00d88d87dd0c3fe3f54fdcb1be7 /helpfuncs.go | |
| parent | b861b92e5d63dcfc3b06030006668fac1247e5a8 (diff) | |
Enha: remade within a popup
Diffstat (limited to 'helpfuncs.go')
| -rw-r--r-- | helpfuncs.go | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/helpfuncs.go b/helpfuncs.go index f5e64ae..350b6ed 100644 --- a/helpfuncs.go +++ b/helpfuncs.go @@ -726,56 +726,3 @@ func scanFiles(dir, filter string) []string { } return files } - -func showFileCompletion(filter string) { - baseDir := cfg.CodingDir - if baseDir == "" { - baseDir = "." - } - complMatches = scanFiles(baseDir, filter) - go func() { - app.QueueUpdateDraw(func() { - if len(complMatches) == 0 { - hideCompletion() // Make sure hideCompletion also uses QueueUpdate if it modifies UI - return - } - // Limit the number of complMatches - if len(complMatches) > 10 { - complMatches = complMatches[:10] - } - // Update the popup's content - complPopup.Clear() - for _, f := range complMatches { - complPopup.AddItem(f, "", 0, nil) - } - // Update state and UI - complPopup.SetCurrentItem(0) - complActive = true - // Show the popup and set focus - pages.AddPage("complPopup", complPopup, true, true) - app.SetFocus(complPopup) - // No need to call app.Draw() here, QueueUpdateDraw does it automatically - }) - }() -} - -func insertCompletion() { - if complIndex >= 0 && complIndex < len(complMatches) { - match := complMatches[complIndex] - currentText := textArea.GetText() - atIdx := strings.LastIndex(currentText, "@") - if atIdx >= 0 { - before := currentText[:atIdx] - textArea.SetText(before+match, true) - } - } - hideCompletion() -} - -func hideCompletion() { - complActive = false - complMatches = nil - pages.RemovePage("complPopup") - app.SetFocus(textArea) - app.Draw() -} |
