-
Notifications
You must be signed in to change notification settings - Fork 28
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
New Feature: Expand to cell #135
Comments
Nice! I was thinking of doing the same thing! I just had a quick look at the code ... and it seems relatively trivial to adapt the existing code base to do this. The current process, as implemented in the block_expand method, is to search from the current line to the end of the file for the block ending comment (as defined in the settings, and by default presumed to be To send code blocks while the cursor is somewhere within the block, rather than at the top, like you suggest, would simply require running this same search that is currently performed upward and downward when necessary. If you've done something like this, I might be inclined to merge it in manually myself. It would definitely be a nice addition to the library!! |
You can find my version here https://github.com/fredcallaway/SendCode but I noticed that master currently has a "block_start_pattern" preference and a corresponding However, if you're into cells, you may find this little command useful: https://github.com/fredcallaway/Fredlime/blob/master/main.py#L94 { "keys": ["alt+down"], "command": "jump_cell"},
{ "keys": ["alt+up"], "command": "jump_cell", "args": {"backward": true}}, |
I'm sorry, I just noticed that you're already aware of the block_expand method. I think it might actually be pretty easy to adapt https://github.com/fredcallaway/SendCode/blob/master/code_getter/getter.py#L7 |
Hi, I'm looking for this behavior.
Could you please guide me how I can do that if this is already done? |
I don't think this is possible with the main package. I have it in my fork, which you could install by removing the standard one and cloning directly into your Packages folder. https://github.com/fredcallaway/SendCode Then add But beware, I've made lots of arbitrary changes to the code to suit my needs; not sure you will like all of them. The basic block expansion logic is implemented in commit |
Thanks @fredcallaway I removed the standard one and installed yours using |
Can you show me the console output with
If I hit ctrl+enter, the console prints:
|
This is the error: command: send_code {"cell": true} |
That line is |
Yes, I did. But this error was before that one: reloading python 3.3 plugin SendCode.send_code |
Ah weird, that folder somehow didn't make it into the git repo. I fixed it. Try pulling the updated repo? |
Thanks @fredcallaway. ConEmuC.exe not found. Specify the path to ConEmuC.exe in SendCode.sublime-settings. |
Oh Sorry, my bad. I didn't adjust the settings. This is working as expected and I deeply appreciate that. |
Is it possible to set the |
I also have commands to move up and down cells without running them here (you could rename the file and put it in the
|
Oh, thank you so much. That's really great. |
Hey there! A while ago, I implemented a feature to expand to the full containing block regardless of where in the block you are in (as opposed to current behavior which requires that you are on the first line of the block (with
# %%
) to run the full cell. This matches the behavior of R studio and (to some extent) jupyter notebooks.Would you consider a pull request? Unfortunately, I made the change on an old version and so it's not trivial to integrate into master, which is why I'm asking before I put in the time.
The text was updated successfully, but these errors were encountered: