![Notepad++ python indent issue](https://cdn3.cdnme.se/5447227/9-3/21_64e61dfdddf2b33c615a3cd4.png)
Doesn't need a minimal amount of rows to trigger indentation detection.Works on the startup tab (when you launch notepad++ to open a file).Here is an improved version based on HYRY's answer : This is only an example, feel free to make guess_tab() better yourself, maybe use a global dict to cache the result and speedup the callback function. You can show the Python console to debug the code. The function buffer_active() is called every time when you switch tab, and guess_tab() checks whether the text is using tab indent or not. On my PC its path is c:\Program Files\Notepad++\plugins\PythonScript\scripts\startup.py, add the following code to startup.py. When Notepad++ starts, the startup.py script will run.įind startup.py and edit it. In the menu: Plugins -> Python Script -> Configuration, and set Initialization to ATSTARTUP.
![notepad++ python indent issue notepad++ python indent issue](https://i.ytimg.com/vi/W9yyqU2j2_8/maxresdefault.jpg)
![notepad++ python indent issue notepad++ python indent issue](https://i.imgur.com/0A0V1.png)
If you install the "Python Script" plugin for Notepad++, you can write code to automatically switch between tabs and spaces.
![Notepad++ python indent issue](https://cdn3.cdnme.se/5447227/9-3/21_64e61dfdddf2b33c615a3cd4.png)