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:
parent
0307a14984
commit
30726b6c6e
1 changed files with 4 additions and 3 deletions
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue