Author Topic: why tab key is replaced by spaces in xxxxx.c file  (Read 4195 times)

hc

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
why tab key is replaced by spaces in xxxxx.c file
« on: June 20, 2014, 07:50:48 pm »
I'm using SlickEdit 2013 (v18.0.1.2 32-bit). When I tried to insert a tab key in .c file it was replaced by spaces (....). In same project, it works fine if I insert a tab in a .cpp file. How do I fix it?
Thanks

davehohl

  • Senior Community Member
  • Posts: 271
  • Hero Points: 27
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #1 on: June 20, 2014, 10:00:23 pm »
Check your settings in Tools|Options|Languages|Application Languages|C/C++|File Options|Expand tabs to spaces

hc

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #2 on: June 23, 2014, 03:25:06 pm »
It is not an extension issue. It seems related to "Use Adaptive Formatting" setting in "All Languages". When I first opened a file (*.c or *.cpp) to insert a Tab key, SlickEdit converted Tab key to spaces. Then I unchecked the "Use Adaptive Formatting" in "Options" and "Apply" and then checked back the "Use Adaptive Formatting" and "Apply". Now inserted Tab key showed as TAB. If I close the file and open it again, Tab key goes back to its original state again. Is this a bug?

hc

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #3 on: June 23, 2014, 03:51:52 pm »
Thanks davehohl for the response.
I tried to set Tools|Options|Languages|Application Languages|C/C++|File Options|Expand tabs to spaces ON and OFF, but it did not change. Inserted Tab key is still converted to spaces.
By the way, in both Tools|Options|File Options|Load and |Save, "Expand tabs to spaces" is set to OFF.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2426
  • Hero Points: 136
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #4 on: June 24, 2014, 01:07:54 pm »
Try looking at C>Formatting>Edit and check out what "Indent with" is set to.

hc

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #5 on: June 24, 2014, 02:06:48 pm »
Hi Dan, thanks for the response.
I tried in Options|Language|Application Languages|ANSI-C|Formatting tab, enable (check) Indent with tabs and Syntax indent: = 4 and Tabs: = +4. Still see the same problem. Actually it was set.
There is no C under "Application Languages". C/C++ does not provide the same settings. These is a Slick-C under "SlickEdit Language" and its Formatting tab is set to same as ANSI-C.

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #6 on: June 25, 2014, 07:57:05 am »
It is not an extension issue. It seems related to "Use Adaptive Formatting" setting in "All Languages". When I first opened a file (*.c or *.cpp) to insert a Tab key, SlickEdit converted Tab key to spaces. Then I unchecked the "Use Adaptive Formatting" in "Options" and "Apply" and then checked back the "Use Adaptive Formatting" and "Apply". Now inserted Tab key showed as TAB. If I close the file and open it again, Tab key goes back to its original state again. Is this a bug?
It sounds like you identified that Adaptive Formatting is what causes the tab behavior to change.  Adaptive Formatting is designed to scan the file and deduce what formatting settings the file uses, and override the explicit default from Tools|Options.

If Adaptive Formatting seems to be involved, then I would recommend:
  • If you don't want Adaptive Formatting to override the defaults, turn Adaptive Formatting off.
  • Or if you do want Adaptive Formatting to override the defaults but you feel it's deducing incorrect formatting in the file, the best thing to do is share the file with the SlickEdit team (i.e. open a Support Case) so they can analyze what's happening.

hc

  • Junior Community Member
  • Posts: 5
  • Hero Points: 0
Re: why tab key is replaced by spaces in xxxxx.c file
« Reply #7 on: June 25, 2014, 07:18:08 pm »
Thanks chrisant for the response.
The way I fix the issue is as follow:
Close all open files in work space. Delete .slickedit fold and then open SlickEdit. In "Quick Start Configuration Wizard", click "Next" to "Coding" tab. Select "Set indent settings for all languages" and select "Indent with tab" with right number. Click "Finish" and then open your WorkSpace/Project.
Settings will go back to default. But press tab key will insert a tab (Hex 0x09)
I didn't change "Coding" tab last time I moved to a different directory. The default setting "Indent with spaces"  was used.