Community
    • Login

    Auto Language detection via Hint

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 3.8k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AJ BaxterA
      AJ Baxter
      last edited by

      is there some feature for detecting the language settings to choice NOT based on file extension?

      i want something like… scan the first 3 lines, and look for a specific string marker and then parse it for a language identifier

      eg. in C languages
      /*
      n+±lang: .C
      */

      1 Reply Last reply Reply Quote 0
      • Claudia FrankC
        Claudia Frank
        last edited by

        Hi AJ Baxter,

        what you can do is writing a python script which can do it.
        Something like

        for i in range(1,3):
            identifier = editor.getLine(i)
            if identifier == 'something to compare':
                notepad.setLangType(LANGTYPE.CPP)
                ...
        

        If you know how it can be identified and you are willing to go this way let me know.
        Btw. what needs to be done, reagrding python script plugin installation and creation
        of script can you read here.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors