You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Only CTRL+ENTER works, and works when placing cursor anywhere in the block
However, with cell:
Both CTRL+ENTER and SHIFT+ENTER work, but behave differently
SHIFT+ENTER works when placing the cursor anywhere in the block, but NOT CTRL+ENTER (it only works when placing the cursor in the beginning of the block)
CTRL+ENTER
The text was updated successfully, but these errors were encountered:
Yep, similar to #3908, this is currently behaving as designed/expected but we are happy to hear feedback about what you were expecting or would prefer.
Shift+Enter is a keyboard shortcut specific to code cells to run the whole code cell. There is a whole set of keyboard shortcuts specific to these kinds of cells:
Similar to what I outline in #3908, the keyboard shortcut to execute the current statement looks for the immediate current complete statement. We do have some open questions about Python statement detection in #3464 if you'd like to add your experiences and preferences there.
@petetronic yes it looks like there's a bug with our fallback regex-based detector. Here's a simple repro:
Write this to a file:
x=# this line is to intentionally create a syntax error so that we fall back to the regex-based detectory= [
0,
]
Place the cursor on the 0, line and press Cmd+Enter.
Only the line 0, gets sent to the console.
It should send the entire y definition to the console.
Note that it works as expected without the x = syntax error.
Possible solutions
We can try to look into fixing this case for the regex-based detector. I wonder though if we should consider moving the AST-based detector to a parser that supports syntax errors (originally raised this here).
I haven't looked into all of the options, but I know that parso (used by Jedi and maintained by the same person) does support error recovery.
Positron: 2024.07.0-15
OS: MacOS
Without cell:
Only CTRL+ENTER works, and works when placing cursor anywhere in the block

However, with cell:
Both CTRL+ENTER and SHIFT+ENTER work, but behave differently
SHIFT+ENTER works when placing the cursor anywhere in the block, but NOT CTRL+ENTER (it only works when placing the cursor in the beginning of the block)
CTRL+ENTER
The text was updated successfully, but these errors were encountered: