From 277a3b244b2b7a8f763b4316dcf9f1a00754d5bf Mon Sep 17 00:00:00 2001 From: abakkk Date: Fri, 18 Sep 2020 11:04:24 +0200 Subject: [PATCH] trim clipboad text lines Since 3.38 there is a line terminator character, that has to be removed with .trim(). --- files.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files.js b/files.js index 22a31bc..8313374 100644 --- a/files.js +++ b/files.js @@ -318,11 +318,12 @@ var Images = { }, addImagesFromClipboard: function(callback) { - Clipboard.get_text(CLIPBOARD_TYPE, (clipBoard, text) => { + Clipboard.get_text(CLIPBOARD_TYPE, (clipboard, text) => { if (!text) return; - - let lines = text.split('\n'); + + // Since 3.38 there is a line terminator character, that has to be removed with .trim(). + let lines = text.split('\n').map(line => line.trim()); if (lines[0] == 'x-special/nautilus-clipboard') lines = lines.slice(2);