Community
    • Login

    Right Justifying Paragraphs

    Scheduled Pinned Locked Moved General Discussion
    24 Posts 6 Posters 10.9k Views 4 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.
    • hoji afzalH Offline
      hoji afzal @guy038
      last edited by hoji afzal

      @guy038

      Thanks a lot; I just tried your steps and they work pretty well.

      If anyone else wants to try it, be sure to use the **numeric **keypad to enter 031.

      I will try (?-i)(?<!\bconst)\x20+ later on. And after that will brush up on my regular expressions :)

      Appreciate your time!

      Hoji

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

        Hi, @hoji-afzal and All,

        In my previous post, I used the control character \x1F as a temporary character, while executing the TextFX Line up option.

        Of course, this is not a mandatory step ! You may, as well, use any symbol, which is NOT part of your block selection, yet ;-)). So, for instance, with your initial block of text :

        public byte PUSH = 1;
        private const int STOP = 0;
        public const double SECS_TO_START = 10;
        public int SEPARATOR = 21;
        

        Any symbol, other than a semicolon and the equal sign, could be appropriate ;-))


        With a hash symbol, for example, the main actions, with your sample text, would be :

        • Copy a single #, in the clipboard

        • Perform a first S/R, below, with Regular expression and In selection options ticked

          • SEARCH (?-i)(?<!\bconst)\x20+

          • REPLACE #

        • Click on TextFX > TextFX Edit > Line up multiple lines by (Clipboard Character)

        • Perform a second S/R, below, with Regular expression and In selection options ticked

          • SEARCH #

          • REPLACE \x20 ( you may, also, use a simple space char, instead ! )


        Of course, if this temporary char is a control character, other than \r or \n, you’re quasi-certain that it is not used anywhere else, in current text or source code file !

        Cheers,

        guy038

        hoji afzalH 1 Reply Last reply Reply Quote 1
        • hoji afzalH Offline
          hoji afzal @guy038
          last edited by

          @guy038

          Got it!
          Notepad++ keeps a history of your searches, which is handy for this kind of operation.
          Thanks a lot.
          Hoji

          1 Reply Last reply Reply Quote 0
          • hoji afzalH Offline
            hoji afzal
            last edited by

            Hi all,

            Just an update: I have been using TextFX in the last 5 months and it does the job pretty well. Was too lazy to try the other methods members graciously provided.

            Thanks!

            1 Reply Last reply Reply Quote 1

            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