mirror of
git://git.sv.gnu.org/nano.git
synced 2024-12-28 05:09:49 +03:00
pasting: when less than a line is pasted, allow automatic hard-wrapping
When --breaklonglines is in effect and the user pasted just a few words (anything without a linebreak), then act as if this short text had been typed by the user and hard-wrap the line when it became overlong. This fulfills https://savannah.gnu.org/bugs/?61353.
This commit is contained in:
parent
ba093b0b48
commit
50106266bc
@ -728,6 +728,10 @@ void paste_text(void)
|
||||
update_undo(PASTE);
|
||||
#endif
|
||||
|
||||
/* When still on the same line and doing hard-wrapping, limit the width. */
|
||||
if (openfile->current == was_current && ISSET(BREAK_LONG_LINES))
|
||||
do_wrap();
|
||||
|
||||
/* If we pasted less than a screenful, don't center the cursor. */
|
||||
if (less_than_a_screenful(was_lineno, was_leftedge))
|
||||
focusing = FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user