Author Topic: Formatting  (Read 151 times)

SeeCwriter

  • Senior Community Member
  • Posts: 116
  • Hero Points: 1
Formatting
« on: April 12, 2019, 05:33:17 pm »
I'm using v23.0.1.2 of SE and the C/C++ language.  When you type an 'if' statement the editor automatically adds the opening and closing braces as it's supposed to. But when I add an 'else' part things sometimes go terribly wrong.
If I try to insert an if..else statement in the middle of existing code, the if portion is fine. When I type 'else' followed by an open brace, the editor will do one of 2-things. 1) it will only enter the opening brace, not the closing brace also as with the 'if', and it uses the next closing brace it finds as the closing brace to the else, which can be the closing brace of the function that it's in. And if I backspace to remove the open brace, because I want it on the next line, it will delete it and the closing brace it found. And I don't always notice that it happened until I get all kinds of compiler errors. or 2) it indents everything to the end of the file assuming it's all going into the else section. This has caused all kinds of confusion and time.
It seems prone to happen when there are no blank lines between the lines of code I'm inserting into. If I enter a number of blank lines where I want to add code, then go back to add the code, that seems to work. 

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1007
  • Hero Points: 86
Re: Formatting
« Reply #1 on: April 15, 2019, 12:24:11 am »
Could you post your user.cfg.xml file, from you config directory?

SeeCwriter

  • Senior Community Member
  • Posts: 116
  • Hero Points: 1
Re: Formatting
« Reply #2 on: April 15, 2019, 02:35:35 pm »
Attached.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1007
  • Hero Points: 86
Re: Formatting
« Reply #3 on: April 16, 2019, 02:13:06 pm »
So far I haven't been able to reproduce those.  I've tried variations on what line the 'else' starts on and what line I type the '{' on.  I had hoped having your configuration would have been enough.  Do you have an example it happens with?