Skip to content

Commit

Permalink
jump over comments and whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
guoci committed May 21, 2023
1 parent 7e895ee commit 4fdf02a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ static void smartExecuteCode(final AnActionEvent e, final Editor editor) {
}
if (codeToSend != null) {
moveCaretDown(editor, numLinesToSubmit);
for(;;) {
final int currentOffset = DocumentUtil.getFirstNonSpaceCharOffset(document,
editor.getCaretModel().getLogicalPosition().line);
final PsiElement pe = psiFile.findElementAt(currentOffset);
if (pe != null && (pe.getNode().getElementType() == PyTokenTypes.END_OF_LINE_COMMENT
|| pe.getNode() instanceof PsiWhiteSpace))
moveCaretDown(editor, 1);
else
break;
}
} else {
syntaxErrorAction(e);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<idea-plugin>
<id>python-smart-execute</id>
<name>Python Smart Execute</name>
<version>0.2.0</version>
<version>0.2.1</version>
<vendor email="[email protected]" url="https://github.com/JetBrains/intellij-community/pull/711">Guo Ci Teo</vendor>

<description><![CDATA[
Expand Down

0 comments on commit 4fdf02a

Please sign in to comment.