Community
    • Login

    All occurrences of token: Not all the same texts are marked (highlighted)

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 393 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.
    • N
      naturwiese
      last edited by

      Hallo,

      Hello,
      in the current version (v8.6.2 64-bit build time: Jan 14 2024 02:16:00) I want to select a text and then highlight it with “Style all occurrences of token”.

      I now realized that not all of the same texts are highlighted.

      Example:

      You should search for this text:
      m.MASSQ.Value - m.MASSFUNTEN.Value - m.MASSE.Value - (m.MODELGROUP.Value == “1” ? 61.5 : 63.0)

      Text to search:
      m.MASSQ.Value - m.MASSFUNTEN.Value - m.MASSE.Value - (m.MODELGROUP.Value == “1” ? 61.5 : 63.0)
      and (m.MASSQ.Value - m.MASSFUNTEN.Value - m.MASSE.Value - (m.MODELGROUP.Value == “1” ? 61.5 : 63.0))
      and ( m.MASSQ.Value - m.MASSFUNTEN.Value - m.MASSE.Value - (m.MODELGROUP.Value == “1” ? 61.5 : 63.0) )

      Only the first and last lines of the text to be searched are highlighted.

      Is there a way to get the second line highlighted too?
      It is absolutely necessary for my work that all the same parts of the text are highlighted.

      Thank you in advance for the support.

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @naturwiese
        last edited by PeterJones

        @naturwiese ,

        My experiments show that you probably have Settings > Preferences > Highlighting > Style All Occurrences of Token > ☑ Match whole word only checkmarked.

        If you are going to be using that feature with partial words, or with multiple words, or with words mixed with puncuation, it’s usually best to remove that setting’s checkmark so that the styling isn’t restricted to matching “whole words”.

        Explanation: When that option is checkmarked, then the beginning of the match must be a “start of word” and the end of the match must be a “start of word”. In your middle instance, the parentheses before and after are touching the match, so then the matching text isn’t at the start/end of the “whole word” unit, and thus don’t match.

        If I have that unchecked, it will highlight all three; if I have it checked, it will highlight the first and second.

        3c503535-9ebe-4bd6-8fc5-6f7adcf82da6-image.png

        N 1 Reply Last reply Reply Quote 2
        • N
          naturwiese @PeterJones
          last edited by

          @PeterJones Thank you. Your tip solved exactly my problem. THANK YOU SO MUCH!

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