guoci / pycharm-smart-execute

PyCharm plugin to execute python code
https://plugins.jetbrains.com/plugin/11945-python-smart-execute
GNU General Public License v3.0
9 stars 1 forks source link

[Feature Request]Add a new line and cursor move down when execute code at the last line. #6

Closed gepcel closed 1 year ago

gepcel commented 1 year ago

I like this plugin very much, and this is not an issue report but a help request. I'm not sure if it's possible or meaningful for you.

Now when smart execute code in the console at the last line of the file, the cursor will stay. How do you think about adding a new empty line after, and moving cursor down?

I've tried to add some empty lines after to make the current line not the last, but the cursor to just jump to the last line and skip all the empty lines in between (so-called next code region).

guoci commented 1 year ago

Your feature request in paragraph 2 is easy to implement, I will consider it.

For the 3 paragraph, the Smart execute code in console, cursor move to last line submitted action will not skip the empty lines, but there is no keyboard shortcut for it.

There are now 3 actions in the plugin for Python code, you can right-click to see them, if you need a keyboard shortcut, you have to set it. image

gepcel commented 1 year ago

Thank you for considering this. Following your instruction, I managed to do Smart execute code in console, cursor move to last line submitted.

I've tried to add some empty lines after to make the current line not the last, but the cursor to just jump to the last line and skip all the empty lines in between (so-called next code region).

My initial thought was, that the cursor could not move down after executing the last line, so maybe if I added many blank lines, the current line wouldn't be the last one, and the cursor would keep moving down one line, and I could continue to type new code. But it turns out the cursor will just skip all the empty lines, and jump to the end.

guoci commented 1 year ago

@gepcel so did Smart execute code in console, cursor move to last line submitted work for you?

guoci commented 1 year ago

I have implemented your feature request. You can download it from https://github.com/guoci/pycharm-smart-execute/releases/tag/0.3.2, or wait for JetBrains to approve the update.

gepcel commented 1 year ago

Thank you for your work. Plugin 0.3.2 works perfectly. I think this can be closed.