Community
    • Login

    using "FOR" in language definition causes unexpected results

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    syntax highlightudl
    3 Posts 2 Posters 1.8k Views 2 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.
    • Charlie FullerC Offline
      Charlie Fuller
      last edited by

      We use a language definition file for our scripting software in Notepad++
      We have an open/close folding definition that includes FOR and END_FOR (in addition to other standard commands)
      The syntax highlighting highlights FOR, but also highlights the letters “for” and “FOR” in words that contain those strings (not just when they exist alone. So if we use FORCE, FOREIGN, FORMAT, REINFORCMENT, BEFORE or other words used as a variable name (not part of our language definition file), the “FOR” part is still highlighted. Since the text editor thinks you are calling the function FOR it messes up code collapsing and is quite a nuisance. Is there a way to fix this. It doesn’t seem to be an issue for other commands like IF, AND, OR… why for FOR?

      1 Reply Last reply Reply Quote 0
      • Jim DaileyJ Offline
        Jim Dailey
        last edited by

        @Charlie-Fuller

        I’m guessing your FOR, END_FOR definitions are in the Folding in code 1 style box. Try moving them to the Folding in code 2 style (separators needed) box.

        1 Reply Last reply Reply Quote 0
        • Charlie FullerC Offline
          Charlie Fuller
          last edited by

          bingo…thankyou thankyou thankyou!

          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