Author Topic: B2: C block paste indent issue  (Read 2731 times)

jc44

  • Senior Community Member
  • Posts: 329
  • Hero Points: 22
B2: C block paste indent issue
« on: August 08, 2019, 03:33:47 PM »
Win 10 x64, Brief emulation.  In this code snippet:

#include <stdio.h>

int main(int argc, char*argv[])
{
   if (argc == 1)
      printf("Argc == 1\n");

   printf("...\n");

   {
      printf("Braces\n");
   }
}

If I block copy the 3 lines of the "braces" block to the line below 'printf("Argc == 1\n");' then it ends up indented too far (in line with that printf).  If I just copy the 'printf("Braces\n")' line to the same place then the indent is correct.

Regards

JC

jc44

  • Senior Community Member
  • Posts: 329
  • Hero Points: 22
Re: B2: C block paste indent issue
« Reply #1 on: September 05, 2019, 11:43:34 AM »
Still in B3

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: B2: C block paste indent issue
« Reply #2 on: September 05, 2019, 11:49:54 AM »
Interesting. Doesn't happen if something that is unbraced is pasted. Looking into this.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: B2: C block paste indent issue
« Reply #3 on: September 05, 2019, 12:58:22 PM »
Fixed for beta 4

jc44

  • Senior Community Member
  • Posts: 329
  • Hero Points: 22
Re: B2: C block paste indent issue
« Reply #4 on: September 23, 2019, 04:48:50 PM »
Yup - thanks - got another one though :-)
Code: [Select]
int main(int argc, char *argv[])
{
    if( 1 )
    {
        if( 1 )
            exit(0);
    } else
        printf("Oops\n");
}

Any paste after the final printf is indented too far.  If the "else" is on the next line rather than on the same line as the "}" then the issue goes away.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: B2: C block paste indent issue
« Reply #5 on: September 24, 2019, 12:21:04 AM »
I'll see if we can improve this. Smart indenting with Enter isn't handling this right so I'm not surprised smartpaste isn't working either 

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6823
  • Hero Points: 526
Re: B2: C block paste indent issue
« Reply #6 on: September 24, 2019, 01:39:26 AM »
Fixed for next build