Author Topic: Problem w/ TCL and automatic braces (Linux v14.0.2.2)  (Read 2836 times)

thokedoke

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« on: January 05, 2010, 11:45:54 pm »
Greetings,

When editing a TCL file, I am seeing problems with text entry and brace auto-insertion/completion.

E.g., when typing the "if" keyword, followed by a space, the following is auto-entered:

      if {}
      }
     


Note that the leading brace for the "if" action clause is missing.   
I am seeing this on v14.0.2.2 on Linux (RHEL5), but not on v12 (Windows).
Applies to "else" and "elseif" as well.

Any suggestions ?

==
Tom

MartyL

  • Senior Community Member
  • Posts: 161
  • Hero Points: 26
  • Synergex Software Engineer
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #1 on: January 06, 2010, 12:54:49 am »
Confirmed on Windows XP. SlickEdit 14.0.2.2.

Also noticed that once you check the "Insert blank line between braces" option and apply, you can no longer turn it back off.
Turning off "Insert braces immediately" will net you the open brace instead of the close brace.

The keywords "for", "foreach" and "switch" also share the open brace problem.

Looking a little more into it. The variable "e1" gets set to contain the open brace. Looks like they are checking the setting to empty the brace variable or not. Got the logic mixed up.

Line 973 in tcl.e is:
Code: [Select]
if ( LanguageSettings.getInsertBeginEndImmediately(p_LangId) ) e1='';
It should be:
Code: [Select]
if ( !LanguageSettings.getInsertBeginEndImmediately(p_LangId) ) e1='';

thokedoke

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #2 on: January 06, 2010, 02:53:59 am »
Interesting...

Good catch and patch :D

That should work with the later call to maybe_insert_braces() for the various styles
(assuming that I'm interpreting the general macro language correctly)

Does SlickEdit support monitor the forum, or should I post a bug ?

==
Tom

LBCEi

  • Senior Community Member
  • Posts: 159
  • Hero Points: 9
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #3 on: January 06, 2010, 04:54:15 am »
Support does monitor the forum but, to be sure that this gets entered into their defect tracking system and gets addressed ASAP, I would post a defect report.

Regards
Les

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #4 on: January 06, 2010, 03:48:59 pm »
Good catch.  I'll include the patch in the cumulative hotfix for v14.  Amazing the difference one little "!" can make.  8)

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #5 on: January 06, 2010, 04:07:25 pm »
MartyL,

I looked into the problem you were having with turning off "Insert blank line between braces."  That problem has already been fixed in the hotfix.  If you apply the latest hotfix, you will no longer have trouble turning off that option.

Hotfixes for v14 can be found at http://www.slickedit.com/index.php?option=com_content&view=article&id=190&Itemid=41.  Be sure to apply the hotfix loader patch before attempting to install the cumulative hotfix.

I will add the fix for TCL to that hotfix.  The cumulative hotfix (including this fix) will likely be updated later in the day.

thokedoke

  • Junior Community Member
  • Posts: 3
  • Hero Points: 0
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #6 on: January 06, 2010, 10:39:56 pm »
Sandra,

Should I assume that the bug is in the database, or would you like me to file it ?

==
Tom

Sandra

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 754
  • Hero Points: 35
Re: Problem w/ TCL and automatic braces (Linux v14.0.2.2)
« Reply #7 on: January 06, 2010, 10:53:29 pm »
No need for you to do anything this time.  In general, it's better to file a bug report, since we can't guarantee that we see everything on these forums.  But this time at least, I've already taken care of it.

Thanks!