Open
Description
It looks like it is not possible anymore to use setLexer to set a language in Notepad++. Scintilla 5 has moved the lexers from Scintilla into a new Lexilla project.
For example, the following code DOES duplicate a file but DOES NOT set its language as the same of original one.
# Get data from current file
anchor = editor.getAnchor()
lang = editor.getLexer()
# Copy all text
editor.selectAll()
editor.copy()
# Clear selection
editor.setAnchor(anchor)
editor.setCurrentPos(anchor)
# Generate new file with same lexer and paste all text
notepad.new()
editor.setLexer(lang)
editor.paste()