Summary: | Klipper should ignore blank entries | ||
---|---|---|---|
Product: | [Plasma] plasmashell | Reporter: | Michal Ziabkowski <mziab> |
Component: | Clipboard widget & pop-up | Assignee: | Esben Mose Hansen <kde> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | CC: | alpha_one_x86, arthur, catchman, kde, marc-kde, nate, patrick.eigensatz, simonandric5, sudhir, voidpointertonull+bugskdeorg |
Priority: | NOR | ||
Version: | 5.15.3 | ||
Target Milestone: | 1.0 | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: | This patch fixes bug #192922 |
Description
Michal Ziabkowski
2009-05-16 19:55:58 UTC
It happens when you select or copy one or more spaces/tabs/newlines. Getting rid of them is tempting, but as a lot of people actually do copy and paste whitespace around, doing so will have to be configurable. In fact, perhaps the best option would be "ignore whitespace differences in history", which would also make all blanks the same & empty. *** Bug 220544 has been marked as a duplicate of this bug. *** *** Bug 126446 has been marked as a duplicate of this bug. *** Any news on that ? This bug is very annoying. I never had this problem with glipper when I was using Gnome. It happen for example when you double click on an empty line, in many programs. *** Bug 316651 has been marked as a duplicate of this bug. *** I just realized that there is an option in klipper preferences : "Prevent empty clipboard" As stated in Klipper doc : "If selected, the clipboard will never be empty: Klipper will insert the most recent item from the clipboard history into the clipboard instead of allowing it to be empty." However this is enabled and not working. Or am I misunderstanding the purpose of this option? I think what klipper is offering to ignore is the empty string, "", whereas we're often thinking of a blank line as a line containing only whitespace. Perhaps I might suggest a heuristic: * When programmers copy around whitespace, it usually has some degree of complexity. * When one accidentally selects whitespace, it's usually trivial, typically either "space" or "newline" or "space+newline". So how about considering 3-or-fewer whitespace characters (i.e. '\s{1,3}' as empty/accidental/unwanted, while including longer entries. It's also very easy to have a completely empty selection (not just whitespace, but the empty string). It would be really useful if the "prevent empty clipboard" functionality could extend to "prevent empty selection". To reproduce the problem: 1. Select some text you want to copy 2. Left click in the window where you want to paste. 3. Accidentally drag the mouse up-and down or left-and-right, causing text (maybe as little as a single space character) to be quickly added to and removed-from the selection. 4. The selection is now inadvertently empty, and middle-clicking to paste it has no effect. This issue should definitely be resolved. Copy-Pasting is one of the most basic thing that I use throughout the day. I am not sure how Klipper has been picking up white spaces as I never copy them intentionally. An option to not to copy white spaces would be very helpful. I would like to add another comment that this bug has become painfully clear in Plasma 5. Now instead of no empty lines it has at least 2-3 empty blank lines. I sincerely hope we could address this issue with a priority. Created attachment 90972 [details] This patch fixes bug #192922 This should fix Bug #192922 My patch fixes Bug #192922. QString::trimmed() is used to check if the string only consists of whitespace characters. If it does, the creation of the HistoryStringItem fails. That patch would prevent people from copying whitspace characters like tabs, spaces, newlines, etc. Isn't this "fixed" already? Klipper seems to ignore more than just blank entries at this point, can be checked easily with: wl-copy "" Indeed. |