This repository was archived by the owner on Nov 7, 2025. It is now read-only.
Add IPyRunCell function to execute a cell.#30
Open
DerWeh wants to merge 1 commit into
Open
Conversation
bfredl
reviewed
Apr 11, 2017
| min_indent = indent | ||
|
|
||
| # Perform dedent | ||
| if min_indent > 0: |
Owner
There was a problem hiding this comment.
This shouldn't be necessary, IPython kernel will strip off largest common indent of a cell automatically.
bfredl
reviewed
Apr 11, 2017
|
|
||
| # Execute cell | ||
| lines = "\n".join(cur_buf[upper_bound:lower_bound+1]) | ||
| reply = self.waitfor(self.kc.execute(lines, silent=silent)) |
Owner
There was a problem hiding this comment.
here instead just call self.ipy_run
bfredl
reviewed
Apr 11, 2017
| cur_buf = self.vim.current.buffer | ||
| (cur_line, cur_col) = self.vim.current.window.cursor | ||
| cur_line -= 1 | ||
| def is_cell_separator(line): |
Owner
There was a problem hiding this comment.
This can probably be implemented much simpler vimL-side, where we can use ordinary regex search(). Instead we should probably have a Python function IPyRunLines which takes a line range.
Owner
|
I implemented cells vimscript side on master. See the "Cells" section in readme. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added wmvanvliet's
wmvanvliet's run_cellfunction, to emulate a cell mode.The collection of lines is implemented in python which should be faster. Please check if I adjusted the code the right way, as I only tried to emulate your
ipy_runfunction with his code and I actually don't know how neovim plug-ins work.The cell separators should probably be refactored into a vimscript variable, to be configurable.