kbrose / vsc-python-indent

Correctly indent python code on the fly, in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=KevinRose.vsc-python-indent
MIT License
82 stars 19 forks source link

Add extra 3 whitespaces when add new line and broke indent #99

Closed TopperBG closed 2 years ago

TopperBG commented 2 years ago

code before enter

def json_handler(self_data):

    if ( self_data['WIFI']['MODE']['current'].upper() == 'CLIENT' ):

        rc, result = CmdTool("wifi-clientup", "tpntoolkit wificlientup").run()
        if rc == 0 :
            result_message = get_wifi_status()
        else:
            result_message = "{}"
    else:

        rc, result = CmdTool("wifi-hostapup", "tpntoolkit wifiap").run()
        if rc == 0 :
            result_message = get_wifi_status()
        else:
            result_message = "{}"|

code after enter with broke ident warning

def json_handler(self_data):

    if ( self_data['WIFI']['MODE']['current'].upper() == 'CLIENT' ):

        rc, result = CmdTool("wifi-clientup", "tpntoolkit wificlientup").run()
        if rc == 0 :
            result_message = get_wifi_status()
        else:
            result_message = "{}"
    else:

        rc, result = CmdTool("wifi-hostapup", "tpntoolkit wifiap").run()
        if rc == 0 :
            result_message = get_wifi_status()
        else:
            result_message = "{}"
...return result_message
kbrose commented 2 years ago

Hi @TopperBG. It looks like you're using tabs instead of spaces for indentation. As mentioned in the caveats section of the README, using tabs for indentation are not supported.

TopperBG commented 2 years ago

I'm aware from that but actualy not image

kbrose commented 2 years ago

Regardless of that setting, the code you have here uses tabs instead of spaces.