kylebarron / vscode-jupyter-python

Run automatically-inferred Python code blocks in the VS Code Jupyter extension
https://marketplace.visualstudio.com/items?itemName=kylebarron.vscode-jupyter-python
MIT License
37 stars 3 forks source link

create a new line after execute the last line (#6) #11

Open xclrr opened 1 year ago

xclrr commented 1 year ago

The code I provided in (#6) is a fix after installing the extension, users can modify run-code.js in .vscode to solve the problem.

I considered four cases

  1. The last code block is a single line
  2. The last code block is multi-line
  3. The last code block is a single line and there are several blank lines below it
  4. The last code block is multi-line and there are several blank lines below Case 1 2: Insert a blank row at the last row and move the pointer there Case 3 4: Move the pointer to the first blank line under the code block

I modified the run-code.ts in the source code and compiled it into a vsix package for testing. No problems have been found in my test. Please compile and test it. I also provide a vsix package that I compiled. unzip_this.zip