• Login
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.
  • P
    Pohli
    last edited by Mar 11, 2017, 2:56 PM

    Hello,

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

    C 1 Reply Last reply Mar 11, 2017, 10:14 PM Reply Quote 1
    • C
      Claudia Frank @Pohli
      last edited by Mar 11, 2017, 10:14 PM

      @Pohli

      anything within View->Show Symbols?

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 1
      • G
        guy038
        last edited by guy038 Mar 12, 2017, 12:58 AM Mar 12, 2017, 12:28 AM

        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

        P 1 Reply Last reply Mar 17, 2017, 9:18 PM Reply Quote 4
        • P
          Pohli @guy038
          last edited by Pohli Mar 17, 2017, 9:19 PM Mar 17, 2017, 9:18 PM

          @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
          • P
            PeterJones
            last edited by Mar 17, 2017, 10:27 PM

            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
            • T
              ThePirate42
              last edited by Aug 6, 2021, 11:21 AM

              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.

              A 1 Reply Last reply Aug 6, 2021, 12:03 PM Reply Quote 0
              • A
                Alan Kilborn @ThePirate42
                last edited by Aug 6, 2021, 12:03 PM

                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