choose-files: Fix TAB completion in file prompt not respecting current cwd
This commit is contained in:
parent
c7a81df950
commit
ada88e063b
1 changed files with 12 additions and 1 deletions
|
|
@ -899,8 +899,19 @@ func main(_ *cli.Command, opts *Options, args []string) (rc int, err error) {
|
|||
handler := Handler{lp: lp, err_chan: make(chan error, 8), msg_printer: message.NewPrinter(utils.LanguageTag()), spinner: tui.NewSpinner("dots")}
|
||||
defer handler.graphics_handler.Cleanup()
|
||||
defer calibre_cleanup()
|
||||
getcwd := func() string {
|
||||
ans := handler.state.CurrentDir()
|
||||
if ans == "" {
|
||||
var err error
|
||||
ans, err = os.Getwd()
|
||||
if err != nil {
|
||||
ans = "."
|
||||
}
|
||||
}
|
||||
return ans
|
||||
}
|
||||
handler.rl = readline.New(lp, readline.RlInit{
|
||||
Prompt: "> ", ContinuationPrompt: ". ", Completer: FilePromptCompleter(handler.state.CurrentDir),
|
||||
Prompt: "> ", ContinuationPrompt: ". ", Completer: FilePromptCompleter(getcwd),
|
||||
})
|
||||
if err = handler.set_state_from_config(conf, opts); err != nil {
|
||||
return 1, err
|
||||
|
|
|
|||
Loading…
Reference in a new issue