ReplMaker.jl icon indicating copy to clipboard operation
ReplMaker.jl copied to clipboard

Implement repl menu for selecting modes

Open MasonProtter opened this issue 6 years ago • 4 comments

I think that having fun the package default to binding a repl mode to a key is probably a bad idea.

One idea that may be preferable is if the package hid all new repl modes behind a menu so one has to press one key to bring up a menu of modes and then another key to select which mode they want.

Another possibility is requiring that the key be accompanied by a modifier key. Ie. one must press alt+} to open the repl mode.

I’m definitely open to suggestions and PRs here. I don’t know how to implement that first idea but the second one is doable.

MasonProtter avatar Jul 14 '18 05:07 MasonProtter

I'm now also in need of this sort of things. It seems now we can easily achieve it by invoking enter_mode!?

thautwarm avatar Nov 11 '19 11:11 thautwarm

I tried this way: https://github.com/thautwarm/UsefulModes.jl ,to create a dedicated mode for selecting modes:

using UsefulModes
link_start!()

selector> ast
ast> 1 + 1
Expr
  head: Symbol call
  args: Array{Any}((3,))
    1: Symbol +
    2: Int64 1
    3: Int64 1

thautwarm avatar Nov 11 '19 13:11 thautwarm

Nice! If you feel like making a PR to ReplMaker.jl with support for a mode selector interface, I'd happily accept it. Otherwise, I'll try to get started on it once I have time.

MasonProtter avatar Nov 12 '19 17:11 MasonProtter

This PR to Julia might help?

rfourquet avatar Dec 10 '19 09:12 rfourquet