From 9c91e6ee51ef3bca36f53effa16533e511b59555 Mon Sep 17 00:00:00 2001 From: TorchedSammy <38820196+TorchedSammy@users.noreply.github.com> Date: Sat, 9 Jul 2022 15:25:11 -0400 Subject: [PATCH] feat: use lua to retrieve readline history --- main.go | 2 +- rl.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9421bfc..99f333a 100644 --- a/main.go +++ b/main.go @@ -116,8 +116,8 @@ func main() { } go handleSignals() - luaInit() lr = newLineReader("", false) + luaInit() // If user's config doesn't exixt, if _, err := os.Stat(defaultConfPath); os.IsNotExist(err) && *configflag == defaultConfPath { // Read default from current directory diff --git a/rl.go b/rl.go index 5e98198..6350aa2 100644 --- a/rl.go +++ b/rl.go @@ -28,7 +28,7 @@ func newLineReader(prompt string, noHist bool) *lineReader { // but it cant have shared history if !noHist { lr.fileHist = newFileHistory(defaultHistPath) - rl.SetHistoryCtrlR("History", lr.fileHist) + rl.SetHistoryCtrlR("History", &luaHistory{}) rl.HistoryAutoWrite = false } rl.ShowVimMode = false