Sublime Forum

Bug with tab indentation and plugin

#1

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

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 ?

Thanks.

0 Likes

#2

Unfortunately, “false” is a true value in Python, because it’s a non-empty string. I think you’re looking for False (no quotes).

0 Likes