Author Topic: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)  (Read 390 times)

jcelle

  • Senior Community Member
  • Posts: 186
  • Hero Points: 5
Hello,
It looks like in JavaScript mode TAB is hard coded with length of 4.
I am attaching my settings : everything seems to be set at 3.
Despite these settings, 4 space are being inserted when I press the TAB key.
What am I missing here ?
Thanks for any advice.
Regards.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #1 on: November 27, 2021, 08:20:58 pm »
I can't reproduce this so far.

Try a default config and then changing the indent

vs +new -sc new-config-dir

jcelle

  • Senior Community Member
  • Posts: 186
  • Hero Points: 5
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #2 on: December 20, 2021, 09:38:55 am »
Hi Clark,
So this is still present in 26.0.1 (I had little hope...)
So I tried what you indicated: using the +new option was good as I went through the initial configuration wizard where I could ask TAB=3 for EVERYTHING...
Now situation in a js file is worse : TAB inserts one space !
Is there a way we could debug my actual configuration ?
*** In fact I have been able to narrow things a little bit : problem appears only within quoted strings !
Does that make sense ? Could there be another TAB behavior within quotes (single or double) ?

Thanks.
« Last Edit: December 20, 2021, 11:23:23 am by jcelle »

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #3 on: December 20, 2021, 02:20:26 pm »
Post a sample file as an attachment.
Post your user.cfg.xml as an attachment. That will give us your settings.
Also provide some precise steps to reproduce the problem (i.e go to line x and press Enter or Tab).

jcelle

  • Senior Community Member
  • Posts: 186
  • Hero Points: 5
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #4 on: December 29, 2021, 04:59:45 pm »
Sure, here we are :
Open a blank javascript file: cursor should be at line 1, column 1.
Press TAB: cursor moves to column 4 : so far so good.
Pres ENTER to go to a new line, press SPACE to position the cursor on line 2, column 2.
Press TAB.
Expected : cursor moves 3 spaces right to column 5
Seen : cursor moves to column 4 again.
I understand this can be desired to have predefined tab stops, but this is not what I want and I made my best to configure slickedit so that TAB = 3 spaces but, whether  I missed it, whether it is not possible...

Thanks for your help.
I wish you all a merry christmas.



Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #5 on: December 29, 2021, 08:52:04 pm »
Set Tab key option to "Indent by syntax indent" (Tools>Options>Web Authoring Languages>JavaScript>Editing).

jcelle

  • Senior Community Member
  • Posts: 186
  • Hero Points: 5
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #6 on: December 30, 2021, 08:48:34 am »
Thanks Clark, this works better for this use case.
However not for this one :
- open empty javascript file
- type SPACE end enter one character : cursor is at column 3, no blank character on column 2
- press TAB
Expected : cursor at column 6
Seen : cursor at column 4

Strange we can't have TAB = 3 spaces whatever context we are in.
Maybe this is the design, just let me know.
All the best.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 6209
  • Hero Points: 482
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #7 on: December 30, 2021, 04:43:41 pm »
Added hot fix for this. This option should always indent by syntax indent when your cursor is on a blank line.

jcelle

  • Senior Community Member
  • Posts: 186
  • Hero Points: 5
Re: bug report: TAB always inserts 4 spaces in JavaScript mode (I want 3)
« Reply #8 on: January 03, 2022, 04:53:21 pm »
Thanks, let's wait.