Skip to content

getLexer and setLexer do not work #271

Open
@dejudicibus

Description

@dejudicibus

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions