Open PetrKryslUCSD opened 5 years ago
Actually, it also does the same thing with no leading space ("args": {"cmd": "?$selection"},
).
To clarify: this is what gets printed:
julia> ?collect
ERROR: syntax: invalid identifier name "?"
when the selection is "collect".
It does not work because julia interprets ?$selection
as a whole thing. There is no easy workaround for now. Basically, you'll need to send the ?
and the selection seperately.
I am not sure I follow. Even sending the ? by itself results in an error:
julia> ?
ERROR: syntax: invalid identifier name "?"
It is because SendCode sends ?\n
rather than just ?
, there is no user option to choose not to commit the text.
Hmm. When I type in ? into the REPL, and then I press return, I don't get an error, I get
help?>
search: ⊻ ⊋ ⊊ ⊉ ⊈ ⊇ ⊆ ≥ ≤ ≢ ≡ ≠ ≉ ≈ ∪ ∩ ∛ √ ∘ ∌ ∋ ∉ ∈ ℯ π ÷ ~ | ^ \ > < : / - + *
Welcome to Julia 1.0.1. The full manual is available at
https://docs.julialang.org/
as well as many great tutorials and learning resources:
https://julialang.org/learning/
For help on a specific function or macro, type ? followed by its name, e.g.
?cos, or ?@time, and press enter. Type ; to enter shell mode, ] to enter
package mode.
Does that have something to do with carriage return versus newline?
Anyway, at the moment I think it's solved reasonably well with
// Send code to display help information. Thanks to @mbauman for the suggestion.
{
"keys": ["ctrl+shift+x", "ctrl+h"], "command": "send_code",
"args": {"cmd": "REPL.@repl $selection"},
"context": [
{ "key": "selector", "operator": "equal", "operand": "source.julia" }
]
}
Thanks for your help.
Perhaps, most standard keyboards send \r
.
Binding the key as
results in an error: ERROR: syntax: invalid identifier name "?"
What am I missing?