Community
    • Login

    Line select problem

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 7 Posters 1.4k 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.
    • Michael LanderM
      Michael Lander
      last edited by

      If I click the area to the left of the line it selects the whole line, which is intended, but it also selects the start of the next line (for instance in this case, line 2) instead of stopping at the end of the selected line.

      Is there a way to change this behaviour?

      line select problem.gif

      EkopalypseE mkupperM PeterJonesP 3 Replies Last reply Reply Quote 0
      • EkopalypseE
        Ekopalypse @Michael Lander
        last edited by

        @Michael-Lander

        If the selected line should contain the line ends, you cannot do anything, because the cursor is always placed before the next position. But if you want to select the line without the line ends, then put the cursor at the beginning of the line and press Shift+end.

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

          Hello, @michael-lander, @ekopalypse and All,

          @michael-lander, you may be interested by my old post, below :

          https://community.notepad-plus-plus.org/post/52044

          Which contains some macros in order to cut/copy/paste text without the final EOL character(s) !

          Best Regards,

          guy038

          Michael LanderM 1 Reply Last reply Reply Quote 4
          • mkupperM
            mkupper @Michael Lander
            last edited by

            @Michael-Lander said in Line select problem:

            If I click the area to the left of the line it selects the whole line, which is intended, but it also selects the start of the next line (for instance in this case, line 2) instead of stopping at the end of the selected line.

            I experimented and it seems the current Notepad++ behavior is desirable in terms of what a person would normally do with the selected line or lines.

            If you want something that can select the entire line without the end-of-line character(s) then I would add a macro shortcut that does [End][Shift-Home][Shift-Home]. I assigned Ctrl-Shift-A to this and it seems to work well.

            I did the shift-home twice as Home goes to the start of the text and Home-Home goes to the start of the line.

            You could also do it as [Home][Home][Shift-End] which will leave the cursor at the end of the line as part of the process. The first version leaves the cursor at the start of the line

            Is there a way to change this behaviour?

            If you can demonstrate or show how the modified behavior would be useful then you could propose it as a new feature.

            Related to that is how would you want to activate it? At present Ctrl-click, Shift-click, right-click etc all seem to have useful and desired behavior when done in the left margin. I see that middle-click is available. I’m assuming that even if a preferences setting was added to make your desired behavior the default that at times you would want to activate the behavior that includes the end of line character(s) at times.

            TBugReporterT 1 Reply Last reply Reply Quote 0
            • PeterJonesP
              PeterJones @Michael Lander
              last edited by

              @Michael-Lander ,

              BTW: this has been discussed before.

              • https://community.notepad-plus-plus.org/topic/18086/how-to-limit-select-line-so-it-does-not-include-carriage-return-linefeed
              • https://community.notepad-plus-plus.org/topic/15859/copy-line-without-line-feed
              • and they even mention the Visual Studio Line Copy plugin, which also might do what you requested
              1 Reply Last reply Reply Quote 1
              • Michael LanderM
                Michael Lander @guy038
                last edited by

                @guy038 this is great! I cannot, however, find any shortcuts.xml to drop them into.

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • TBugReporterT
                  TBugReporter @mkupper
                  last edited by TBugReporter

                  @mkupper said in Line select problem:

                  Home goes to the start of the text and Home-Home goes to the start of the line.

                  Not always - if the cursor happens to already be at the start of the text on the line (and that happens to be a different position than the start of the line - IOW, if there is leading whitespace on the line), then the first Home will take it to the start of the line, and the second will bring it back to where it was originally. I would use [End][Home][Home][Shift-End] instead of just [Home][Home][Shift-End].

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

                    @TBugReporter said in Line select problem:

                    I would use [End][Home][Home][Shift-End] instead of just [Home][Home][Shift-End].

                    The default key assignment of Alt+Home seems to always move the caret to column 1 of the current line. I haven’t done any digging, but I’m sure this has been discussed on this forum several times previously. Thus perhaps [Alt+Home][Shift+End] will suffice.

                    1 Reply Last reply Reply Quote 1
                    • PeterJonesP
                      PeterJones @Michael Lander
                      last edited by

                      @Michael-Lander said in Line select problem:

                      @guy038 this is great! I cannot, however, find any shortcuts.xml to drop them into.

                      %AppData%\Notepad++\shortcuts.xml

                      See FAQ

                      1 Reply Last reply Reply Quote 0
                      • Terry RT Terry R referenced this topic on
                      • First post
                        Last post
                      The Community of users of the Notepad++ text editor.
                      Powered by NodeBB | Contributors