When highlighting/selecting a complete line by double clicking or clicking at the front of the line, it also selects the line feed at the end. Is there a setting or a way to allow selecting a complete line without the line feed?

]]>https://notepad-plus-plus.org/community/topic/15859/copy-line-without-line-feedRSS for NodeMon, 21 Jan 2019 20:32:13 GMTFri, 01 Jun 2018 15:20:59 GMT60When highlighting/selecting a complete line by double clicking or clicking at the front of the line, it also selects the line feed at the end. Is there a setting or a way to allow selecting a complete line without the line feed?

]]>https://notepad-plus-plus.org/community/topic/15859/copy-line-without-line-feedhttps://notepad-plus-plus.org/community/topic/15859/copy-line-without-line-feedFri, 01 Jun 2018 15:20:59 GMTYou could record a macro that does HOME -> HOME -> SHIFT-END and assign it a hot key. The first HOME brings it to the first non-whitespace character in the line, the second HOME will bring it to zero column.

]]>https://notepad-plus-plus.org/community/topic/15859/copy-line-without-line-feed/2https://notepad-plus-plus.org/community/topic/15859/copy-line-without-line-feed/2Fri, 01 Jun 2018 15:54:53 GMTTried that and it works, giving me a workaround. I was hoping there was a setting that changed the default of copying the ‘complete’ line with CR/LF to just copying the text without. It becomes about workflow and needing to add extra keystrokes to get the job done instead of just clicking at the front of the line and pressing Ctrl-C quickly. Maybe a “New Feature” request?? LOL

Many people will argue that it is not a (complete) “line” without a line-ending on it (and I would tend to agree with that definition), thus when you triple (not double!) click a line, it should select contents plus line-ending.

The workflow can actually be improved by the macro approach…you could add the “copy” to it for reduced action count if you do this often. I think the complaint with the workflow you made might be because you have to do something different than what you are used to doing.

I think the “HOME -> HOME -> SHIFT-END” approach has a slight flaw–depending upon where the caret is on the line when this is invoked, you might end up not getting the entire desired text selected (hint: try the sequence with the caret right on the first non-whitespace character of an indented line). This assumes that the Home key is mapped to its default setting (and of course same for Shift+End). Better would be a single press of Alt+Home (again, default kemapping) followed by the Shift+End.

Scoot, I did some tests, also considering the case of an indented line, which is wrapped in several physical lines, with the cursor on the first physical line OR on the following ones !

And , to my mind, the best way, by macro, to select any complete line, without its End of Line chars, whatever the cursor location , with the default N++ shortcuts, should be any of the 5 shortcuts sequences, below :

Alt + Home , Home, Home, Shift + End, Shift + End

Home, Home, Alt + Home , Shift + End, Shift + End ( Thanks to Scott )

If you also want to select its line-break, simply add the Shift + Right Arrow shortcut

I tested this sequence with :

A single line non-indented

A single line, indented

A multi-lines non-indented

A multi-lines indented

I tried with and w/o the menu option View > Word wrap and with each case of Line Wrap, in Settings > Preferences...> Editing ( Default, Aligned and Indent )

I’m not going to look it up, but I will wager that these are exactly the 5 command steps that you outlined directly above. What this all means is…I’m sure we’ve discussed this before in the Community! And, of course, that turns out to be true… :-D