Skip to content

Lexer for CMakeLists.txt is guessed incorrectly #523

@Anteru

Description

@Anteru

(Original issue 816 created by sijk on 2012-10-21T23:28:14.507932+00:00)

Files named CMakeLists.txt are correctly assigned a CMakeLexer if you use get_lexer_for_filename. They are incorrectly assigned a TextLexer if you use guess_lexer_for_filename.

#!python
In [2]: guess_lexer_for_filename('CMakeLists.txt','')
Out[2]: <pygments.lexers.TextLexer>

In [3]: get_lexer_for_filename('CMakeLists.txt')
Out[3]: <pygments.lexers.CMakeLexer>

Given CMakeLists.txt is a more specific name than *.txt it seems to me that both functions should return a CMakeLexer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-minorseverity: minorT-bugtype: a bugX-importedimported from Bitbucket

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions