force 4 spaces and "Use spaces instead of tabs"

114 views
Skip to first unread message

dex

unread,
Feb 6, 2012, 1:01:04 PM2/6/12
to intype...@googlegroups.com
Intype runs some auto-detection and decides number of spaces and to use tabs or spaces. That is fine. 

But sometimes when you receive code from different sources and want to make sure that all new code that goes in is always "4 spaces-no tabs" constant switching of the option is very annoying.
It would be nice to have ability to turn-off auto-detect and force certain editing options on all newly open documents. Permanent setting.

Martin "Cohen" Balazik

unread,
Feb 6, 2012, 1:15:18 PM2/6/12
to intype...@googlegroups.com
Seems reasonable enough, though a little bit dangerous. I'll give it some thoughts.

Our original plan was to add the forcing but also offering a conversion for the existing indentation. Also project is planned to contain a forcing/check feature for these.

Nonetheless, this would not fit to our plan before 1.0, so we would look at it after 1.0.
--
Martin "Cohen" Balážik

Wojciech Zieliński

unread,
Feb 7, 2012, 7:15:30 AM2/7/12
to intype...@googlegroups.com
I still think that best possible option is to turn off autodetection and set it in options in bundle file, or user bundle options.

dex

unread,
Feb 7, 2012, 7:42:39 AM2/7/12
to intype...@googlegroups.com
I agree with Mr. Wojciech Zieliński . 

Simply turn off autodetect and make tab/space options set in Preferences.

BTW: when version 1.0 is expected to be out? Approx.

MCMayor

unread,
Feb 8, 2012, 9:54:05 PM2/8/12
to intype...@googlegroups.com
I have had problems with this as well. It's stealthily replacing my spaces with tabs. Very bad when the spaces mean something!

Martin "Cohen" Balazik

unread,
Feb 9, 2012, 12:56:35 PM2/9/12
to intype...@googlegroups.com
Intype is auto-detecting that the document is indented with tabs or spaces.

If it does not work, it is a bug. In that case, please let us know what version of Intype you have and possible send the file you're having problems with so we can take a look and possibly tune the auto-detection algorithm.

Also it would be awesome if you could describe the operation which is replacing the tabs / spaces.

On 9 February 2012 03:54, MCMayor <birdieat...@yahoo.com> wrote:
I have had problems with this as well. It's stealthily replacing my spaces with tabs. Very bad when the spaces mean something!



--
Martin "Cohen" Balážik

Martin "Cohen" Balazik

unread,
Feb 9, 2012, 1:00:46 PM2/9/12
to intype...@googlegroups.com
I'll add the feature to "turn off autoindentation" to the todo list.

The feature for setting these defaults based on grammar via bundle settings is in the plans.
--
Martin "Cohen" Balážik

MCMayor

unread,
Feb 10, 2012, 10:25:20 PM2/10/12
to intype...@googlegroups.com
The file needn't be complicated to cause this.
Type in 16 spaces, then hit Enter.
The first line will be spaces, the next tabs.

Or even more strangely, copy-paste will replace spaces with tabs.
Type in Enter, then 16 spaces.
ctrl->a, ctrl->c, deselect, ctrl->v
Second line has 16 spaces, third has 4 tabs.

The file that was actually causing this problem was a Ruby script with inline quotation. I copy-pasted it over from elsewhere and was surprised to see my program suddenly failing.

Running Intype 0.9.2 in Windows 7
0.rb

Martin "Cohen" Balazik

unread,
Feb 11, 2012, 4:05:16 PM2/11/12
to intype...@googlegroups.com
Hm, ok I'll make a few tests. Thank you for the details.
--
Martin "Cohen" Balážik

Martin "Cohen" Balazik

unread,
Feb 11, 2012, 4:25:07 PM2/11/12
to intype...@googlegroups.com
Ok I have tested it, and the explanation is simple:

Intype always inserts indentation by what is set in the bottom bar no matter what you have copied or inserted before, every new indentation is formatted by that bottom-bar settings.

Intype has an auto-detection algorithm to always choose indentation mode by the file when you open it, though now I see that there is a really strange bug causing Intype to not detect the indentation correctly (it simply says Tabs). We will take a look at the bug ASAP and push a fix.

So if you have "Tabs" set in the bottom bar and you insert spaces and hit enter, Intype will count how many spaces there was on the line, but on the next line it will insert tabs simply because you have said Intype to do so.
--
Martin "Cohen" Balážik

Martin "Cohen" Balazik

unread,
Feb 13, 2012, 5:39:24 AM2/13/12
to intype...@googlegroups.com
We have just released a hotfix that fixes the auto-detection. Although for your file, the bottom "data" block messes up the indentation detector a little (it detects Spaces(3) format).
--
Martin "Cohen" Balážik
Reply all
Reply to author
Forward
0 new messages