Author Topic: v29.0.2 : different completion behavior when I enter "if("  (Read 16459 times)

jcelle

  • Senior Community Member
  • Posts: 268
  • Hero Points: 6
Hello, I just switched to version 29.0.2.
I am noticing a different behavior in PHP mode when I enter "if(" at the beginning of a non empty line.
In version 26.0.3, entering "if(" just enters "if(" unless I am on a blank line, in which case it enters the closing parenthesis automatically "if()".
That seems perfect: no closing parenthesis if there is text on the right of the cursor, automatic insertion of closing parenthesis otherwise.

In version 29.0.2, I always get a closing parenthesis which I always have to remove when typing "if(" at the beginning of a non blank line.
Besides in version 29.0.2 I get surrounding rectangle drawn which I don't understand. I am quite sure there might be some clever feature I could use here but I can't understand what.
I went through all the configuration screens but could not spot what to update.
Does anyone knows how to disable the 29.0.2 closing parenthesis and surrounding rectangle ?
Thanks in advance.
I'll try to attach some screenshots.
(apparently we can no longer attach images...)
« Last Edit: May 19, 2025, 02:29:04 PM by jcelle »

jcelle

  • Senior Community Member
  • Posts: 268
  • Hero Points: 6
Re: v29.0.2 : different completion behavior when I enter "if("
« Reply #1 on: May 19, 2025, 02:36:14 PM »
Ah found it !
untick "Auto-close / Use Horizontal Dynamic Surround"

jcelle

  • Senior Community Member
  • Posts: 268
  • Hero Points: 6
Re: v29.0.2 : different completion behavior when I enter "if("
« Reply #2 on: May 27, 2025, 11:57:30 AM »
Hello again,
Well I found a use case rather annoying where I am getting an unwanted closing parenthesis.
Always when trying to update an existing line where I want to surround an existing block of code by ().
In following code sample I'll indicate the cursor position by |.
if( |false == $b )
Now I press ( expecting if( (|false == $b )
But I get if( (|)false == $b )
This forces me to hit the DEL key to remove this extra )
I have "Auto-Close/Enable Auto-Close/Parenthesis"  ticked (that is 2 checkboxes ticked).
What should I do ?
Thanks and regards.


Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7109
  • Hero Points: 541
Re: v29.0.2 : different completion behavior when I enter "if("
« Reply #3 on: May 27, 2025, 12:51:18 PM »
Please post your user.cfg.xml and a sample file for reproducing this.

jcelle

  • Senior Community Member
  • Posts: 268
  • Hero Points: 6
Re: v29.0.2 : different completion behavior when I enter "if("
« Reply #4 on: May 27, 2025, 03:28:25 PM »
Hello Clark, thanks for your reply. It is interesting because I am realizing that indeed this does not happen everywhere !
Hence this sample :
Code: [Select]
<?
// inserting a ( just before 'false' inserts (
if( false == $b ) { }
// inserting a ( just before '-1' inserts ()
if( -1 == $this->waRrId ) { }
I no longer see any option to attach a file to the post.
Am I missing something ?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 7109
  • Hero Points: 541
Re: v29.0.2 : different completion behavior when I enter "if("
« Reply #5 on: May 27, 2025, 04:12:47 PM »
It looks like its working the way it was designed. It's not perfect but tries to insert depending on context with very simple analysis. A minus sign is ambiguous. Like I said, it does very simple analysis (no advanced parsing of the code).

Seems like posting attachments is somewhat broken. Attachments will have to be emailed to support.
« Last Edit: May 27, 2025, 05:11:19 PM by Clark »

jcelle

  • Senior Community Member
  • Posts: 268
  • Hero Points: 6
Re: v29.0.2 : different completion behavior when I enter "if("
« Reply #6 on: May 28, 2025, 05:31:51 AM »
I agree. Thanks again for your time.