Author Topic: RC1: Space deleted before function open parenthesis  (Read 1491 times)

jorick

  • Senior Community Member
  • Posts: 340
  • Hero Points: 15
RC1: Space deleted before function open parenthesis
« on: October 21, 2015, 07:43:38 pm »
I have my options set so that there's a space before the opening parenthesis on function calls (Options -> Languages -> Application Languages -> C/C++ -> Formatting => Spacing -> Declarations -> Functions/Methods -> Before opening parenthesis = ON).

I was adding a function parameter that was a structure element from a pointer.  I typed -> to get the element list and selected an element.  Immediately upon selection, the space between the function name and opening parenthesis was removed.

Win 7 Pro, RC1, C language

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1000
  • Hero Points: 84
Re: RC1: Space deleted before function open parenthesis
« Reply #1 on: October 22, 2015, 12:03:02 pm »
I'm a little stumped on this one so far.  Just to make sure I have the right idea, you have something like this, where '|' is where the cursor comes up:

Code: [Select]
    someFunc (x|);
'x' is a pointer to a structure.  You type '->' and then you get the completion dialog for the structure members, and when you select one, the space gets removed between 'someFunc' and the '('?  Are you selecting the structure member with the mouse, or a set of keypresses, and if so what keypresses?  And what's your emulation? 

jorick

  • Senior Community Member
  • Posts: 340
  • Hero Points: 15
Re: RC1: Space deleted before function open parenthesis
« Reply #2 on: October 22, 2015, 03:04:46 pm »
That's correct.  After selecting the structure member, the space disappears.  It doesn't matter if I select using the mouse or the keyboard.  On the keyboard, I use the down arrow a number of times to get to the member and then hit Enter.

I'm using Codewright emulation.

jorick

  • Senior Community Member
  • Posts: 340
  • Hero Points: 15
Re: RC1: Space deleted before function open parenthesis
« Reply #3 on: October 22, 2015, 06:12:54 pm »
Here's another scenario.  If I have the following line:
Code: [Select]
Display_Draw_BMP (xptButton->sptBMPEnabled, xptButton->stUpperLeft,
               DISPLAY_DRAW_NORMAL);
and on the line before it I type "if " to generate the parenthesis and braces, the space goes away after the generation but before I use the arrow keys to move the ending brace to include the line, as shown:
Code: [Select]
         if ()
         {

         }
         Display_Draw_BMP(xptButton->sptBMPEnabled, xptButton->stUpperLeft,
               DISPLAY_DRAW_NORMAL);

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1000
  • Hero Points: 84
Re: RC1: Space deleted before function open parenthesis
« Reply #4 on: October 22, 2015, 08:28:49 pm »
I can reproduce the second one, I'll investigate that one.  Thanks for the test case.

patrick

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 1000
  • Hero Points: 84
Re: RC1: Space deleted before function open parenthesis
« Reply #5 on: October 23, 2015, 05:51:49 pm »
I've fixed the case with the function below a syntax expansion getting the space removed. 

I don't know about the one where you're doing a structure member completion inside of a function call.  At this point I'm unsure if I was using your configuration when I tried to reproduce it last, so I'm going to revisit it later this afternoon.

(EDIT: actually, I just reproduced it on the first try using the function call from your 'if' example.  I'm looking at it.)
« Last Edit: October 23, 2015, 05:58:59 pm by patrick »