-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support in custom REPL modes #332
Comments
Bump! |
I think I solved this problem by adding this keymap: # For every typed character, we insert it and update the line. This approach is
# necessary to make OhMyREPL.jl works in TerminalPager.jl.
line_update_keymap = Dict{Any, Any}(
"*" => function(s, data, c)
LineEdit.edit_insert(s, c)
LineEdit.refresh_line(s)
end
)
tp_mode_keymaps = Dict{Any, Any}[
line_update_keymap,
mk,
prefix_keymap,
skeymap,
help_mode_transition_keymap,
LineEdit.history_keymap,
LineEdit.default_keymap,
LineEdit.escape_defaults,
]
tp_mode.keymap_dict = LineEdit.keymap(tp_mode_keymaps) But I am not sure if this is the correct approach. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @KristofferC !
I have a package (TerminalPager.jl) that defines a custom REPL mode to show large outputs inside a pager. When I enable OhMyREPL.jl, the highlight only works when I type certain characters. For example, if I type
function
in normal REPL, it gets highlighted immediately:However, if I enter my custom mode, this does not happen:
The only way to make the line highlighted is if I type backspace, enter, or move the cursor using the left/right keys (at least it was what I found):
It seems that I need to call some function to refresh the line at each character. Maybe I can add OhMyREPL as extension for TerminalPager.jl, but I just do not know what should I do. Can you help me?
The text was updated successfully, but these errors were encountered: