[repl] completion based on dictionary's words and vars

This commit is contained in:
Gwenhael Le Moine 2022-02-15 11:15:16 +01:00
parent fece818539
commit 0b125b6b53
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

2
rpl.rb
View file

@ -53,7 +53,7 @@ class RplRepl
def run
Readline.completion_proc = proc do |s|
Readline::HISTORY.grep(/^#{Regexp.escape(s)}/)
(@interpreter.dictionary.words.keys + @interpreter.dictionary.vars.keys).grep(/^#{Regexp.escape(s)}/)
end
Readline.completion_append_character = ' '