PyCharm adds a semicolon after pressing Enter (new file type)
Hello,
I'm doing a new project with Kivy and using the .kv extension, so I defined a new "File type" and syntax highlighting for it.
But when pressing enter and the end of a line, Pycharm is adding an unwanted semicolon. I don't know how to fix that.
Edit: It seems it only happens if the line ends in ':'.
I have uploaded via web form a small video called
pycharm_adds_semicolon.mp4
I just want how to disable such behaviour for this file type.
Thank you
Please sign in to leave a comment.
Hi, can you please export your whole IDE settings using File > Export settings... and upload them for me to take a look at?
This is it:
https://www.dropbox.com/s/pckhf46rehv3foa/settings.zip?dl=0
Thanks for the settings. Unfortunately I couldn't reproduce the issue - I've tried the same code as in your video, but the ";" character was never added in my case regardless of how I tried.
Is this issue happening only for .kv files? Have you tried in other file types? Have you tried other text editors?
Please ensure that you don't have any third-party macros/hotkey software running in the background, and try to disable any custom plugins you might have in PyCharm.
It happens also with .py files. Pressing enter within a line ending with ':'
And it happens in another projects, so it's not a per-project thing
Have you tried other editors? It looks like a system wide behavior, likely not related to IDE.
If the issue is only in PyCharm, try resetting all settings to default and check if it resolves the issue. The procedure is below:
1. Export your settings using **File > Export Settings...** command.
2. Delete PyCharm config and plugin directories, which can be located according to the following article: https://intellij-support.jetbrains.com/hc/en-us/articles/206544519
3. Restart PyCharm. It will start with default settings, like after fresh installation.
4. Open your project and try to reproduce the issue with the default settings.
After the test, you can import your previously exported settings back.
Well, it seems like doing all that did the trick.
Thanks. If I see this happening again, I'm commenting here.
Ok, then maybe it was some setting, like macro, or live template... although I don't know why it would behave like that. Sometime it's easier to just reset the settings.
I think I didn't ever set a macro. I don't know about templates, I made one live template for kivy tags, but didn't include ';'.
Thanks anyway. =:-)
I have the same problem, however I cannot follow the suggested solution because there is no "Export settings ..." command. What can I do?
Edit: Ok I just found the "Export settings ..." command and followed the instructions, but the problem unfortunately remains. I have no idea why and it's super annoying.
PyCharm 2022.1.1 (Professional Edition)
Build #PY-221.5591.52, built on May 10, 2022
Runtime version: 11.0.14.1+1-b2043.45 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 2028M
Cores: 12
Non-Bundled Plugins:
org.textmapper.idea (0.9.30)
MatlabSupport (0.8.4)
sourcery.pycharm-plugin (0.12.0)