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

Eval selection #7

Open
lopho opened this issue Feb 9, 2019 · 9 comments
Open

Eval selection #7

lopho opened this issue Feb 9, 2019 · 9 comments
Labels
enhancement New feature or request

Comments

@lopho
Copy link

lopho commented Feb 9, 2019

Selecting multiple lines and evaluating them with shift-enter works as intended with atom tidal.
On vscode it only executes the line on which the caret resides.

I'm not sure if this is intended or a bug, but it makes working with tidal in vscode more or less unfeasible for me. Or I am a bit blind and just don't get how it's supposed to work :/

Not evaluatable without executing the entire block with shift-enter ctrl-enter:

d1 $ s "hh*4"
  # up "0 1 2 1"

(Related to this, but not sure if a separate issue (not sure if atom handled this) are nested do blocks.
Running multiline eval with shift-enter ctrl-enter on an nested do block executes the entire do stack, excluding the root scope.)

@kindohm
Copy link

kindohm commented Feb 9, 2019

@lopho to eval a block, you can also use Ctrl+Enter without selecting the entire block. just make sure your cursor is inside the block.

That being said, being able to make a selection and run it with shift+enter would be a good enhancement, and to make it on par with the Atom package.

@lopho
Copy link
Author

lopho commented Feb 9, 2019

Yes, evaling a do block works with ctrl-enter (oopsie, typo in issue description), but it actually evals the surrounding do blocks as well if nested.

Evaluating the inner block, evaluates the outer as well:

do
  d1 $ s "hh*8"
  do -- can't let you eval that do block alone, mane
   d2 $ s "sd*2" 

Do I understand you correctly, that indented lines, like in the example in the issue description, should also eval with ctrl-enter (and nothing else)? If so, it does not do what it should on my machine, it evals the entire stack down to, but excluding, the root.

@lopho
Copy link
Author

lopho commented Feb 9, 2019

So I deconvoluted my workspace scrapbook a bit, and tried executing indented multiline statements using ctrl-enter. It works, but only as long as they are on the root, e.g. not in another block, then the entire surrounding block stack gets evaluated.

-- evals correctly with ctrl-enter:
d1 $ s "hh*8"
  # up "1 2 3 4" -- caret is here

-- evals entire do block, not just indented multi line:
do
  d2 $ s "bd*2"
  d1 $ s "hh*8"
    # up "1 2 3 4" -- caret is here, ctrl-enter, evals entire do block :(

Well, I guess this is all is workable if when selection evaluation gets implemented.

@kindohm
Copy link

kindohm commented Feb 9, 2019

Ahhh, I see. Thanks for the PR I will pull down and test as soon as I can!

@lopho
Copy link
Author

lopho commented Feb 9, 2019

Nice! I commented on the PR regarding ctrl+enter for evaluating selections containing multiple single line statements. After just reading the tidal atom readme regarding ctrl+enter, this should be the behavior on atom, but I'm almost certain it never actually worked that way, or was supposed to, but is broken.

@lopho
Copy link
Author

lopho commented Feb 12, 2019

Implemented multi-line and single-line statement evaluation with selection.
Got into a bit of trouble with the mocking system though. I wrote a bit more in length on the PR (#8).

@kindohm kindohm added the enhancement New feature or request label Sep 4, 2019
@redraw
Copy link

redraw commented Apr 21, 2021

Not sure if this happens to you, but it's like the extension key bindings are not language specific to *.tidal files, but all instead. If I'm editing a Python file, and try to insert a new line below (Ctrl+Enter) it triggers tidal's eval command.

@razzeee
Copy link

razzeee commented Jul 11, 2021

This also breaks committing changes in the git view, as the keybinding is defined to be global. Setting it's when value to editorTextFocus might help a bit.

@joanofxyz
Copy link

I've set both keybindings to have "editorTextFocus && resourceExtname == '.tidal'" for its when expression and it works perfectly. Is this something that should be made default by the extension?

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

No branches or pull requests

5 participants