question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cursor jumps out of fenced code block editing Python code

See original GitHub issue

Hi @vsch, I noticed that when I am editing Python code in a fenced code block like:

```python
def func():
   print()
```

When I press enter e.g. after the print() the cursor jumps upwards to the beginning of the fenced code block (so ot just before the “```”). Is that error known already?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
vschcommented, Jun 1, 2018

@obestwalter, I am first trying it on previous 2018.2 EAP, then latest. If it craps out then it is part of the IDE issue. I had exactly this bug with IDEA, WebStorm and PhpStorm. I could not use them because I have a lot of fenced code in docs and this bug made it impossible to work with them.

Turning off language injections into fenced code solved the problem before but I like editing the language fragment in separate window to I could not be happy with that.

1reaction
vschcommented, Jun 1, 2018

@obestwalter, can confirm that previous 2018.2 EAP gets an exception when editing fenced code with language injections. The cursor did not jump but I could not insert a line when hitting return.

The latest EAP that I installed just now seems to work for fenced code but was getting some exceptions not related to the plugin. I disabled cloud sync to stop the errors and it seems to be working.

The error does sound like it is an IDE issue. Last time it happened I tried Markdown Support and it too was getting these errors. You can see if Markdown Support also has the same problem.

If the plugin has issues with language injections then it happens on all versions and it happens if I change implementation code, which I have not touched in months, if not the last year.

Here is the latest version I installed:

PyCharm 2018.2 EAP (Professional Edition) Build #PY-182.2757.17, built on May 30, 2018 PyCharm EAP User Expiration date: June 29, 2018 JRE: 1.8.0_152-release-1226-b7 x86_64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o macOS 10.12.6

Read more comments on GitHub >

github_iconTop Results From Across the Web

(Python) cursor jumps to the end of a function - Stack Overflow
I use PyCharm on Win10, which per it's default hotkey layout has Ctrl + ] to jump to the end of a code...
Read more >
Cursor moves to beginning of line automatically disrespecting ...
Typing enter to go to a new line, causes the cursor to automatically move to the beginning of the line disrespecting the current...
Read more >
VS Code tips — Jump to cursor while debugging Python
Use ' Jump to Cursor ' while debugging Python in VS Code to immediately jump execution to the cursor position.Unlike 'Run to Cursor...
Read more >
Markdown editing with Visual Studio Code
Fenced code blocks ; Html code blocks; Paragraphs. Smart select within a Markdown document expands from a block element, to the block element....
Read more >
Fenced Code Blocks — Python-Markdown 3.4.1 documentation
The Fenced Code Blocks extension adds a secondary way to define code ... It is generally best to separate the attribute list from...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found