Skip to content
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

Send block #114

Open
jtrakk opened this issue Oct 17, 2021 · 2 comments
Open

Send block #114

jtrakk opened this issue Oct 17, 2021 · 2 comments

Comments

@jtrakk
Copy link

jtrakk commented Oct 17, 2021

Emacs 27.2
Julia 1.6.1
julia-repl-20210408.639

I want to execute a multiline code block:

[1,2,3] |>
maximum

C-c C-c is julia-repl-send-region-or-line which only sends the line by default. vscode-julia sends the whole block. Would it be possible to have that in emacs too?

@wentasah
Copy link
Contributor

I personally use the following function:

  (defun julia-send-paragraph ()
    (interactive)
    (save-mark-and-excursion
      (mark-paragraph)
      (julia-repl-send-region-or-line)))

It behaves differently than VS Code, because the block must be delimited by empty lines and AFAIK VS Code automatically recognizes multi-line expressions without extra delimiters. But for me, it's sufficient most of the time.

@jtrakk
Copy link
Author

jtrakk commented Oct 17, 2021

That may be an improvement, thanks. As you note, sometimes paragraph is too small, e.g. if there are blank lines in the block, and sometimes too large, e.g. if there are multiple independent blocks without blank lines between them.

It looks like LanguageServer uses julia/getCurrentBlockRange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants