Home Download Buy Blog Forum Support

Bug with tab indentation and plugin

Bug with tab indentation and plugin

Postby geekuillaume on Wed Feb 27, 2013 12:00 pm

Hello everyone,
I'm trying to write my first plugin for ST2, its purpose is to use the same indentation as emacs from our School (Epitech in France).
Basicaly, I need to stop the autoindent and insert 2 spaces before each line (according to the indentation level), but if I got more than 8 spaces at a start of a line, it must be replaced by a tab.
I also need real tabs in other places in the code.
My code is totally open-source : https://github.com/geekuillaume/SublimTek.

Here is the bug : I use
Code: Select all
self.view.settings().set("translate_tabs_to_spaces", "false")

but it still insert spaces.
In the "View" menu, the option "indent using spaces" is not active.
To use tabs I need to call the plugin and then activate and deactivate the option in the "View" menu.

Am I doing something wrong or is it really a bug ?

Posts: 1
Joined: Wed Feb 27, 2013 11:00 am

Re: Bug with tab indentation and plugin

Postby adzenith on Wed Feb 27, 2013 4:28 pm

Unfortunately, "false" is a true value in Python, because it's a non-empty string. I think you're looking for False (no quotes).
Posts: 1403
Joined: Mon Oct 19, 2009 9:12 pm

Return to Technical Support

Who is online

Users browsing this forum: No registered users and 30 guests