Author Topic: C# indentation issue (beta 4)  (Read 994 times)

arog

  • Community Member
  • Posts: 19
  • Hero Points: 3
C# indentation issue (beta 4)
« on: September 17, 2018, 10:06:47 pm »
Slickedit 23.0.0.5, macOS 10.12.6, C#

Below is an indentation issue I've been having after installing the beta (upgrading from 2017).  Using tabs indents, but, after an if block, code will be indented with 3 spaces, not tabs or 12 spaces.  Hopefully this isn't just a configuration problem on my side, but it happened directly after upgrading from 2017 without changing any settings.

adaptive-format-stats seems to be 100% that it should be indented with tabs.

Hitting tab at the beginning of a broken line will not fix the indent, like it normally does if you hit tab at the start of a badly indented line.

Running Beautify (a selection or the whole file) will fix it for those lines, but adding a new line directly after a block will go back to 3 spaces.

Fixing a line by hand or with beautify will allow lines after that to correctly indent with tabs, but it will go bad again after the next if block.

Brace style does not seem to matter.

Here is an example.  It was created by just typing into a blank buffer, in order.

Code: [Select]
namespace Namespace {
public class Error {
public void TestTest() {
int x = this.WorksFine();

int y = this.AlsoWorks();

if ( x == y ) {
this.Works();
}
   this.IsBroken();
   
   this.StillBroken();
   
if ( x == y ) {
this.WorksAgain();
x = 7;

   if ( y != x ) {
   // I really don't get this one: prefixes the 3 spaces with tabs to get the correct indent?!
   this.IsBrokenInADifferentWay();
   }
   }
}
}
}

Let me know if you need any more detail / test cases / configuration options.  Thanks!

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5171
  • Hero Points: 427
Re: C# indentation issue (beta 4)
« Reply #1 on: September 19, 2018, 03:52:07 pm »
Definitely a problem due to tabs. We will look into this.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 5171
  • Hero Points: 427
Re: C# indentation issue (beta 4)
« Reply #2 on: September 19, 2018, 04:16:39 pm »
This will be fixed in beta 5

arog

  • Community Member
  • Posts: 19
  • Hero Points: 3
Re: C# indentation issue (beta 4)
« Reply #3 on: September 19, 2018, 05:30:19 pm »
Thank you!