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.
Is there a way to change this behaviour?
-
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
. -
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-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 lineIs 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.
-
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
-
@guy038 this is great! I cannot, however, find any shortcuts.xml to drop them into.
-
@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]
. -
@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. -
@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
-