From d3f297e7a60ffcdcb0c5bc828e44d52129886a00 Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Wed, 22 Aug 2018 09:12:48 -0500 Subject: [PATCH] Describe keys as Meta and link to Mac keyboard configuration. Fixes #28 --- README.md | 8 +++++--- docs/src/usage.md | 24 ++++++++++++++---------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 6c72b40..02605c6 100644 --- a/README.md +++ b/README.md @@ -26,12 +26,14 @@ Note that Rebugger may benefit from custom configuration, as described in the do In terms of usage, very briefly - "step in" is achieved by positioning your cursor in your input line to the beginning of - the call expression you wish to descend into. Then hit Alt-e ("enter"). -- for an expression that generates an error, hit Alt-s ("stacktrace") + the call expression you wish to descend into. Then hit Meta-e ("enter"). +- for an expression that generates an error, hit Meta-s ("stacktrace") to capture the stacktrace and populate your REPL history with a sequence of expressions that contain the method bodies of the calls in the stacktrace. -Complete examples are provided in the documentation. + Meta means Esc or, if your system is configured appropriately, + Alt (Linux/Windows) or Option (Macs). +More information and complete examples are provided in the documentation. ## Status diff --git a/docs/src/usage.md b/docs/src/usage.md index 86b6775..b4b62d5 100644 --- a/docs/src/usage.md +++ b/docs/src/usage.md @@ -2,10 +2,14 @@ Rebugger works from Julia's native REPL prompt. Currently there are two important keybindings: -- Alt-e maps to "enter" or "step in" -- Alt-s maps to "stacktrace" (for commands that throw an error) - -If you're on OSX, you may want to enable +- Meta-e maps to "enter" or "step in" +- Meta-s maps to "stacktrace" (for commands that throw an error) + +Meta reliably maps to `Esc`, and if using `Esc` you should hit the two keys in +sequence rather than simultaneously. +For many users `Alt` (or `Option`) may be more convenient, as it can be pressed +simultaneously with the key. +If you're on OSX, you may want to enable "[Use `option` as the Meta key](https://github.com/timholy/Rebugger.jl/issues/28#issuecomment-414852133)" in your Terminal settings to avoid the need to press Esc before each Rebugger command. @@ -18,7 +22,7 @@ at the desired location in the command line: ``` -Now if you hit Alt-e, you should see something like this: +Now if you hit Meta-e, you should see something like this: ```@raw html @@ -33,10 +37,10 @@ The magenta line tells you which method you are stepping into. Indented blue line(s) show the value(s) of any input arguments or type parameters. If you're following along, move your cursor to the next `show` call as illustrated above. -Hit Alt-e again. You should see a new `show` method, this time with two input arguments. +Hit Meta-e again. You should see a new `show` method, this time with two input arguments. Now let's demonstrate another important display item: position your cursor at the -beginning of the `_show_empty` call and hit Alt-e. +beginning of the `_show_empty` call and hit Meta-e. The display should now look like this: ```@raw html @@ -73,7 +77,7 @@ Stacktrace: in expression starting at REPL[3]:1 ``` -Now hit the up arrow and then Alt-s. After a short delay, you should see something like this: +Now hit the up arrow and then Meta-s. After a short delay, you should see something like this: ```julia julia> colorant"hsl(80%, 20%, 15%)" ┌ Warning: Tuple{getfield(Colors, Symbol("#@colorant_str")),LineNumberNode,Module,Any} was not found, perhaps it was generated by code @@ -141,7 +145,7 @@ Stacktrace: [13] add(::String) at /home/tim/src/julia-1.0/usr/share/julia/stdlib/v1.0/Pkg/src/API.jl:69 [14] top-level scope at none:0 -julia> Pkg.add("NoPkg") # hit Alt-s here +julia> Pkg.add("NoPkg") # hit Meta-s here Captured elements of stacktrace: [1] pkgerror(msg::String...) in Pkg.Types at /home/tim/src/julia-1.0/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:120 [2] ensure_resolved(env::Pkg.Types.EnvCache, pkgs::AbstractArray{Pkg.Types.PackageSpec,1}) in Pkg.Types at /home/tim/src/julia-1.0/usr/share/julia/stdlib/v1.0/Pkg/src/Types.jl:860 @@ -184,7 +188,7 @@ Stacktrace: [2] copyto!(::Array{Float64,1}, ::UnitRange{Int64}) at ./abstractarray.jl:723 [3] top-level scope at none:0 -julia> copyto!(dest, 1:4) # hit Alt-s here +julia> copyto!(dest, 1:4) # hit Meta-s here Captured elements of stacktrace: [1] copyto!(::IndexStyle, dest::AbstractArray, ::IndexStyle, src::AbstractArray) in Base at abstractarray.jl:727 [2] copyto!(dest::AbstractArray, src::AbstractArray) in Base at abstractarray.jl:723