Community
    • Login

    Automatically add space to end of line

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    6 Posts 4 Posters 4.2k 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.
    • Bill FloracB
      Bill Florac
      last edited by

      Is there a way to automatically add spaces if one arrows right at the end of the line rather than wrap?

      1 Reply Last reply Reply Quote 0
      • Scott SumnerS
        Scott Sumner
        last edited by

        I’m not sure exactly where you’re heading with your question, however, it might be worth pointing out that if you are simply trying to quickly move to a column beyond the normal end-of-line (so that you can start typing something beginning in that column), clicking in the desired spot with the mouse while you hold the Alt key will get the caret there.

        From that point when you begin typing, spaces will be inserted from the old end-of-line to the new caret column, followed by the text you typed.

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

          Strangely, there is an exception if the first key you press is Enter. In that case no spaces are added.

          1 Reply Last reply Reply Quote 0
          • Scott SumnerS
            Scott Sumner
            last edited by

            That is interesting. I guess the obvious workaround for that is space, backspace, and then Enter.

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

              Hi Scott,

              Up to now, I thought that the unique way to get the virtual space functionality, was to define the message 2596, with the appropriate value, with the help of a Python, Lua or NppExec script. Refer to the Scintilla documentation, below :

              http://www.scintilla.org/ScintillaDoc.html#MultipleSelectionAndVirtualSpace

              So, after many years of work, with N++, I haven’t guessed, yet, your simple tip : ALT + Left mouse click, anywhere, in the editor window ! Really incredible ! Many thanks , Scott, for that hint, indeed :-)

              Cheers,

              guy038

              1 Reply Last reply Reply Quote 0
              • Scott SumnerS
                Scott Sumner
                last edited by

                It works because the Alt+Lclick is really starting a column-block, just no drag while holding Alt down to define that block. Column-blocking, out of necessity, needs to work with virtual spacing as some lines that may be in the column block might be shorter than others.

                I don’t turn on permanently the beyond end-of-line movement modification as guy038 describes, because I found that that causes some strange behavior with auto-indentation in the language I typically use most often (Python). Actually, I do have a pythonscript tied to a keypress that toggles cursor end-of-line “freedom” mode on and off for when I want it.

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