Community
    • Login

    How can I highlight all functions in Python?

    Scheduled Pinned Locked Moved General Discussion
    3 Posts 3 Posters 2.1k Views 3 Watching
    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.
    • Shu-Ting PiS Offline
      Shu-Ting Pi
      last edited by

      In python, all function must be called in this way: func(a=3, b=2) or test.func(a=3, b=2)
      Apparently, any words before a “( )” is a function.

      How can I let notepad++ to highlight a function in Python?

      Claudia FrankC Scott SumnerS 2 Replies Last reply Reply Quote 0
      • Claudia FrankC Offline
        Claudia Frank @Shu-Ting Pi
        last edited by Claudia Frank

        @Shu-Ting-Pi

        I assume you are referring to the function call, not the function definition, correct?
        If so, short answer - you can’t if you use the builtin lexer.

        The only way to make this happen is to write your own python lexer or use an plugin
        like ScintilluaPlusPlus or python script plugin together with pygments module.

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 0
        • Scott SumnerS Offline
          Scott Sumner @Shu-Ting Pi
          last edited by

          @Shu-Ting-Pi

          You could use the Mark feature along with a regular expression that would highlight these function calls, but it wouldn’t be automatic…meaning that you would have to “refresh” it occasionally…

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors