Home Download Buy Blog Forum Support

Tab keypress bug?

Tab keypress bug?

Postby oriceon on Fri Aug 05, 2011 10:52 am

Hello, sometimes when i press tab key (even if in settings i have "tab_size": 4, ) it will indent with only 2 spaces.
Anybody else has this problem?

I`m on Windows 7 x64 using dev 2097
oriceon
 
Posts: 56
Joined: Tue Jun 14, 2011 6:06 am

Re: Tab keypress bug?

Postby jps on Fri Aug 05, 2011 11:13 am

When you press tab with translate_tabs_to_spaces on, it won't always insert tab_size spaces, it'll insert enough spaces to take you to the next tabstop (i.e., the next column that's a multiple of tab_size), which will insert between 1-tab_size spaces
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Tab keypress bug?

Postby oriceon on Fri Aug 05, 2011 12:15 pm

Sorry, i didn`t understand you. Why in some cases when i press tab it will insert 4 space ( = tab with size 4) and in other cases.. only 2 ( = tab with size 2). :)
In user settings i have

Code: Select all
   "translate_tabs_to_spaces":false,
   "tab_size": 4


http://screencast.com/t/ZJz17h9gyPr

see that please
oriceon
 
Posts: 56
Joined: Tue Jun 14, 2011 6:06 am

Re: Tab keypress bug?

Postby jps on Fri Aug 05, 2011 12:38 pm

That's working as it should - tab indents up to the next tab stop.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Tab keypress bug?

Postby mikeh on Thu Aug 11, 2011 2:11 pm

I think I'm seeing the same problem...

I've got tab_size set to 3 (and translate_tabs_to_spaces: true in my case), but repeatedly pressing tab will only indent by 2 spaces each time.

(Using "." to represent a space)
Code: Select all
...foo
bar

Repeatedly pressing "tab" with the cursor just before "bar":
Code: Select all
...foo
..bar

....bar

......bar
etc.


jps wrote:When you press tab with translate_tabs_to_spaces on, it won't always insert tab_size spaces, it'll insert enough spaces to take you to the next tabstop (i.e., the next column that's a multiple of tab_size), which will insert between 1-tab_size spaces

For me, it seems that the tabstops are always at multiples of 2.

Thanks,
Mike
mikeh
 
Posts: 4
Joined: Thu Aug 11, 2011 2:06 pm

Re: Tab keypress bug?

Postby jps on Thu Aug 11, 2011 2:26 pm

Check the indentation settings that are applied to the current file, via the View/Indentation menu - it sounds like the automatic indentation detection is setting the tab_size to 2 for you. You can disable it via setting the detect_indentation setting to false.
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: Tab keypress bug?

Postby mikeh on Thu Aug 11, 2011 2:29 pm

jps wrote:Check the indentation settings that are applied to the current file, via the View/Indentation menu - it sounds like the automatic indentation detection is setting the tab_size to 2 for you. You can disable it via setting the detect_indentation setting to false.

Brilliant! Yes, that was exactly it.

It still amazes me how much there is to this editor I've yet to discover!

Many thanks,
Mike
mikeh
 
Posts: 4
Joined: Thu Aug 11, 2011 2:06 pm


Return to Technical Support

Who is online

Users browsing this forum: excalibur1976, Google [Bot] and 26 guests