Community
    • Login

    Show no-break space

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 6 Posters 36.0k 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.
    • PohliP
      Pohli
      last edited by

      Hello,

      is there any way to show no-break spaces (U+00A0)?

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

        @Pohli

        anything within View->Show Symbols?

        Cheers
        Claudia

        1 Reply Last reply Reply Quote 1
        • guy038G
          guy038
          last edited by guy038

          Hi, Pohli,

          The NO-BREAK SPACE character ( of Unicode code-point 00A0 ) is just displayed as the usual SPACE character and, unfortunately, cannot be visualized, with a specific glyph, when using the option View > Show Symbol

          To see the interest of the the NO-BREAK SPACE :

          • Choose the option View > Show Symbol > Show all characters

          • Choose the option View > Word wrap

          • Type any text, which continues on the next line

          • Now, select the last SPACE character ( very small orange dot ! )

          • Replace it by a NO-BREAK SPACE ( ALT + 0,1,6,0 on the Numeric keypad )

          => Immediately, the last word, of the first line, is moved at beginning of the second one. Logical, as the two words, before and after the NO-BREAK SPACE character, are, from now on, considered as a single orthographic entity !

          Of course, for searching any NO-BREAK SPACE, just type \xa0, in the Find dialog.

          But a nice and easy way to visualize all the NO-BREAK SPACE characters, of a text, would be to select one of them and, then, use the menu option Search > Mark All > Using 1st style to Using 5th style. ( I specially like the default colour of the fourth style ! )

          Best Regards,

          guy038

          PohliP 1 Reply Last reply Reply Quote 4
          • PohliP
            Pohli @guy038
            last edited by Pohli

            @guy038 said:

            Of course, for searching any NO-BREAK SPACE, just type \xa0, in the Find dialog.

            But a nice and easy way to visualize all the NO-BREAK SPACE characters, of a text, would be to select one of them and, then, use the menu option Search > Mark All > Using 1st style to Using 5th style. ( I specially like the default colour of the fourth style ! )

            That’s a good workaround for me, thanks alot!

            Best regards,

            Pohli

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

              If you have PythonScript plugin installed (assuming UTF-8 or UTF-8-BOM encoding), go to the console and type:

              editor.setRepresentation("\xC2\xA0"," NBSP ")
              

              in the >>> line, and hit RUN. To undo,

              editor.clearRepresentation("\xC2\xA0")
              

              If anyone knows how to escape characters in the NPP_EXEC command line, the same could be done with it’s SCI_SENDMSG. Actually, what will happen if I copy/paste a true NBSP between the first set of quotes?

              SCI_SENDMSG 2665 " " "NBSP"
              SCI_SENDMSG 2667 " "
              

              It works! (I won’t guarantee that the forum keeps the blank between the spaces as an NBSP; if not, you can type it like guy038 suggested)

              (SCI_SETREPRESENTATION is 2665; SCI_CLEARREPRESENTATION is 2667; see here)

              So, you can change the representation with either NPP Exec or PythonScript plugin.

              1 Reply Last reply Reply Quote 4
              • ThePirate42T
                ThePirate42
                last edited by

                For convenience this is a NppExec script to toggle the alternative representation method of NBSPs suggested by PeterJones:

                sci_sendmsg SCI_GETREPRESENTATION " " @""
                if "$(MSG_LPARAM)" == "" then
                  sci_sendmsg SCI_SETREPRESENTATION " " "NBSP"
                else
                  sci_sendmsg SCI_CLEARREPRESENTATION " "
                endif
                npp_setfocus sci
                

                Remember to change all the spaces inside the

                " "
                

                parts into actual NBSPs, since the forum converts them in normal spaces.

                Alan KilbornA 1 Reply Last reply Reply Quote 0
                • Alan KilbornA
                  Alan Kilborn @ThePirate42
                  last edited by

                  For those interested, there’s a PythonScript way of doing this sort of thing, HERE.

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