MasonProtter / ReplMaker.jl

Simple API for building repl modes in Julia
Other
134 stars 14 forks source link

How to disable auto completion? #10

Closed gcalderone closed 4 years ago

gcalderone commented 4 years ago

The initrepl function accepts a completion_provider keyword which, by default, provides the Julia REPL auto completion feature.

Which value should I pass to completion_provider to disable auto completion for a custom repl?

MasonProtter commented 4 years ago

Ah, great question, I hadn't thought about this. It appears that REPL.LineEdit.EmptyCompletionProvider() is what you want:

julia> using ReplMaker

julia> function parse_to_expr(s)
           quote Meta.parse($s) end
       end
parse_to_expr (generic function with 1 method)

julia> using REPL; using REPL.LineEdit: EmptyCompletionProvider

julia> initrepl(parse_to_expr, 
                       prompt_text="Expr> ",
                       prompt_color = :blue, 
                       start_key=')', 
                       mode_name="Expr_mode",
                       completion_provider=REPL.LineEdit.EmptyCompletionProvider())
REPL mode Expr_mode initialized. Press ) to enter and backspace to exit.

Expr> Rep #hitting <TAB> doesn't do anything! 
gcalderone commented 4 years ago

Yes, it works. Thank you!