monrelop.blogg.se

Notepad++ python indent issue
Notepad++ python indent issue













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

If you install the "Python Script" plugin for Notepad++, you can write code to automatically switch between tabs and spaces.















Notepad++ python indent issue