I'd like to know if it's possible to switch to a different language, through scripting, instead of going through: Menu:Language:[any-language]
In python script, you can do notepad.setLangType(LANGTYPE.HTML)
You can set the language type of a different buffer than the current home
by supplying the buffer id as the second parameter.
Obviously languages are settable to whatever you need. See
line 93 for a list (sadly this list is missing from the
Hello Dave, thank you for answering.
I've put the only line "notepad.setLangType(LANGTYPE.CSS)" in a new py script. Restarted. Now when I run the script (Menu:Plugins:Python Script:Scripts:[my-script.py]), NPP++ crashes and a runtime error is returned. Here is the error capture: [IMG]http://i49.tinypic.com/1r68u9.png[/IMG]
(NPP++ 6.2.3 along with PyScript 0.9.2)
These lines work. Unfortunately I don't know how to run a check on the input value, against the available <LangType> values in https://github.com/davegb3/PythonScript/blob/master/PythonScript/src/NotepadPython.cpp
from Npp import *
bufferID = notepad.getCurrentBufferID()
inputLANG=notepad.prompt("Insert the <LangType> value to convert into (case insensitive):", "Notepad++ Prompt", "")