• Login
Community
  • Login

Turn on cursor beyond EOL + Remove unnecessary spaces when saving

Scheduled Pinned Locked Moved General Discussion
9 Posts 7 Posters 6.9k 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.
  • S
    Szász-Fábián József
    last edited by Mar 26, 2017, 8:35 PM

    Turbo Pascal, Delphi and many other editors have a very convenient setting, that is “Cursor beyond EOL”. Then a related option: “Remove unneded spaces on save”, which removes unnecesary spaces from each line, BUT not the empty lines at the end of the document.
    Is there a similar setting in NPP - or there is a hack to achieve this?

    The sticky cursor is very annoying when

    • navigating among very lone and very short lines when the cursor initially was toward the end of a long line
    • mouse-selecting long lines and the mouse cursor goes below or above the line being selected
    • editing indented text with multiple columns
    C S 2 Replies Last reply Mar 26, 2017, 9:07 PM Reply Quote 0
    • C
      Claudia Frank @Szász-Fábián József
      last edited by Mar 26, 2017, 9:07 PM

      @Szász-Fábián-József

      For example, Python or Lua Script could be used to register for file saved message and act on behalf.
      Do you know Edit->Blank Operations->Trim Trailing Spaces? Is this what you are looking for?

      Don’t get the point about the cursor? Could you elaborate on it?

      Cheers
      Claudia

      1 Reply Last reply Reply Quote 0
      • S
        Scott Sumner @Szász-Fábián József
        last edited by Mar 27, 2017, 1:25 AM

        @Szász-Fábián-József

        Did you Google “Notepad++ cursor beyond end of line”? Seems hard to believe that you didn’t, as pretty much that exact phrase occurs in your posting.
        Here is the first hit, and it works as I’ve pointed others here before:
        https://superuser.com/questions/401551/notepad-cursor-past-end-of-line-virtual-spaces

        There is also a Pythonscript way to accomplish the same thing.

        1 Reply Last reply Reply Quote 1
        • S
          Szász-Fábián József
          last edited by Szász-Fábián József Mar 28, 2017, 12:46 AM Mar 28, 2017, 12:45 AM

          @Claudia-Frank

          I’m often using Edit->Blank Operations->Trim Trailing Spaces, however due to indentation, lots of tab-filled empty lines are created during edit, so this menu points needs to be used frequently to keep the text clean.

          What was I thinking is an option with checkbox

          Trim trailing spaces on save,

          of course, clear by default.

          @Scott-Sumner

          Yes I googled, and I found the solution you linked, however, again this is a suggestion of having this option out-of-the-box in NPP, which is Settings -> Preferences ->

          Cursor beyond EOL
          .
          Also, since any plugin may easily crash NPP (for example after a major update), I prefer to keep the plugin list short as possible :-)

          A G 2 Replies Last reply Mar 28, 2017, 1:41 AM Reply Quote 0
          • A
            Alan Kilborn @Szász-Fábián József
            last edited by Mar 28, 2017, 1:41 AM

            @Szász-Fábián-József

            I’m sorry to have to tell you this, but you do not have realistic expectations for Notepad++. The two things you suggest will never be implemented (my prediction), simply because they, in effect, already exist. You just don’t want them in the form that they exist. Power users of Notepad++ have long gotten over such desires, because for one they see that they never get implemented, and secondly that it is not that important how the functionality is implemented as long as it is.

            1 Reply Last reply Reply Quote 0
            • G
              gstavi @Szász-Fábián József
              last edited by Mar 28, 2017, 5:30 AM

              @Szász-Fábián-József
              Did you try ALT-SHIFT-S?
              Look at Shortcut Mapper --> Macros.

              1 Reply Last reply Reply Quote 1
              • P
                PeterJones
                last edited by Mar 28, 2017, 1:06 PM

                @Szász-Fábián-József

                As @gstavi pointed out, the Shortcut Mapper > Macros shows the shortcut for the Macro > Trim Trailing And Save (TT&S). There’s no need to tick a setting box to change save-mode: just use the shortcut appropriate to the command you want.

                Moreover, if you want to usually use TT&S instead of a normal Save, you can do a shortcut swap (like I do): Using the Shortcut Mapper, set the TT&S shortcut to Ctrl+S, then (still in the shortcut mapper) go to Main menu > Save and change its shortcut to Alt+Shift+S (which is what TT&S was). This results in your standard Ctrl+S doing a TT&S, and the alternate shortcut (or the Save button on the toolbar) doing a standard Save (without trim).

                Good luck.

                1 Reply Last reply Reply Quote 1
                • C
                  Codereamp
                  last edited by Mar 19, 2025, 10:51 AM

                  Hi,

                  I’m new to this forum. First, thanks for the great software and for keeping it great for all these years!

                  As for this topic, two points.

                  • Since a simple google query [npp space cursor] sometimes lists this topic at the top, I think it’s great to mention that the original question was addressed with the implementation of the Virtual Space (Editing1 -> Enable Virtual Space).
                  • In the docs section Editing 1 the link inside “… feature in Editing > Virtual Space…” is broken an leads to a non-existing page. Maybe the page explaining the feature is yet not ready, so just in case

                  Thanks!

                  P 1 Reply Last reply Mar 19, 2025, 3:30 PM Reply Quote 1
                  • P
                    PeterJones @Codereamp
                    last edited by Mar 19, 2025, 3:30 PM

                    @Codereamp said in Turn on cursor beyond EOL + Remove unnecessary spaces when saving:

                    In the docs section Editing 1 the link inside “… feature in Editing > Virtual Space…” is broken an leads to a non-existing page. Maybe the page explaining the feature is yet not ready, so just in case

                    Just a typo in the href. Fixed.

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