Completion code cleanup and improvements (#958)

- Clean up some code duplication.
- When completing files with menu completion while searching, don't
  escape the selected match.
- Don't recompute completions while cycling completion menu.
This commit is contained in:
Paul Ouellette authored and GitHub committed 2022-10-15 16:05:17 +03:00
1 parent 8c490dddd2
commit cdbc9948f8
3 files changed
+112 -232

No files matched your search

+13 -10
View File
@@ -20,16 +20,19 @@ type cmdItem struct {
}
type app struct {
ui *ui
nav *nav
ticker *time.Ticker
quitChan chan struct{}
cmd *exec.Cmd
cmdIn io.WriteCloser
cmdOutBuf []byte
cmdHistory []cmdItem
cmdHistoryBeg int
cmdHistoryInd int
ui *ui
nav *nav
ticker *time.Ticker
quitChan chan struct{}
cmd *exec.Cmd
cmdIn io.WriteCloser
cmdOutBuf []byte
cmdHistory []cmdItem
cmdHistoryBeg int
cmdHistoryInd int
menuCompActive bool
menuComps []string
menuCompInd int
}
func newApp(ui *ui, nav *nav) *app {