0

I'm currently working on a project in PyCharm and I often find myself needing to remove line breaks for readability purposes. However, when I use PyCharm's Ctrl+Shift+J shortcut to join lines, it automatically adds semicolons to the end of each joined line.

I've tried looking through the PyCharm documentation and searching online, but I haven't been able to find a solution. I also went through the PyCharm settings to see if there is an option to turn off the automatic semicolon addition, but couldn't find anything related to that.

Any help or suggestions would be greatly appreciated! Thank you.

HussainBiedouh
  • 99
  • 2
  • 11
  • Shift+J or Ctl+Shift+J? – Barmar Apr 09 '23 at 21:48
  • It should only add `;` if the lines you're joining are statements, since that's how you separate multiple statements on the same line. If you're joining in the middle of an argument list or bracketed expression, it shouldn't do that. – Barmar Apr 09 '23 at 21:49
  • Ctrl+Shift+J, my mistake. I corrected the question – HussainBiedouh Apr 10 '23 at 06:14
  • What i'm joining is a multiline MySql query – HussainBiedouh Apr 10 '23 at 06:15
  • 1
    Please post a screenshot of the Editor window showing the pace where you are doing it. Showing more is better to provide more context. Ideally a small screencast/video to see it in action. There could be some nuances that you may be ignoring but may explain such a behavior... Please also always state the IDE version (in case if there is a difference in behaviour between versions) – LazyOne Apr 10 '23 at 10:34
  • This is a multi-line string in triple quotes? I'm really surprised it gets this wrong. I haven't used PyCharm, but I use PhpStorm and it's pretty good at knowing the context. – Barmar Apr 10 '23 at 14:51
  • No, just a simple string "This is an example of what I am talking about" – HussainBiedouh Apr 14 '23 at 06:46

0 Answers0