1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00

Fix pasting of multi-line clipboard.

Previous newline removal only removed trailing newline.
This commit is contained in:
Dave Davenport 2017-01-03 12:20:21 +01:00
parent 0307a14984
commit 30726b6c6e

View file

@ -840,9 +840,10 @@ static void rofi_view_paste ( RofiViewState *state, xcb_selection_notify_event_t
if ( text != NULL && text[0] != '\0' ) {
unsigned int dl = strlen ( text );
// Strip new line
while ( dl > 0 && text[dl] == '\n' ) {
text[dl] = '\0';
dl--;
for ( unsigned int i = 0; i < dl; i++){
if ( text[i] == '\n' ){
dl = i;
}
}
// Insert string move cursor.
textbox_insert ( state->text, state->text->cursor, text, dl );