Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Clipboard History pre appends 'http://' to anything that looks like a URL #775

Closed
mechanicalchopsticks opened this Issue Mar 27, 2012 · 9 comments

Comments

Projects
None yet
3 participants

This is pretty annoying, it think it should not manipulate in any way what is stored.

Owner

skurfer commented Mar 27, 2012

it should not manipulate in any way what is stored

I agree, and it doesn’t. If you paste such an item, you’ll see that the http:// isn’t there unless it was part of what you copied originally. It also doesn’t appear in the label. Only in the details underneath. (It used to actually prepend it to the contents preventing you from ever pasting what you copied, which was very annoying.)

This bit is more for @pjrobertson

Having said that, maybe the answer here is to not run sniffString on clipboard contents at all. For instance, copy the text =5*8 and then look at your clipboard history. I’ll go look at the pull request.

Owner

skurfer commented Mar 27, 2012

If you paste such an item, you’ll see that the http:// isn’t there unless it was part of what you copied originally.

I take it back. Yes it does (if you use the Paste action on an item in the history).

Owner

pjrobertson commented Mar 27, 2012

@skurfer see #776
There was a bug in the pasteboard stuff.

I think your point about not sniffing clipboard strings is valid (but unrelated). I will have a think about it. If we didn't sniff the string, would it be 'right' that if I copied ~/Library/Caches to the clipboard it wouldn't resolve to the file? Probably

Owner

pjrobertson commented Mar 27, 2012

For @skurfer ...

I think your change would be as simple as altering QSObject_Pasteboard.m:121

The only downside to your proposed change is for things like URLs. If I copy a URL to the clipboard, then want to open it, I can't (as it'd be a string)
But I guess that's what the shelf is for?

Maybe a solution is to store the strings as URLs if they start with a scheme like http:// ssh:// etc, just don't assume that if it ends with .com or .net it is needs to start with http://

Owner

skurfer commented Mar 27, 2012

The only downside to your proposed change is for things like URLs. If I copy a URL to the clipboard, then want to open it, I can't (as it'd be a string)
But I guess that's what the shelf is for?

Personally, I don’t think I’ve ever wanted to open a “sniffed” URL from the clipboard history. I’m more likely to get the URL with ⌘⎋ than copy it. You could also hit . to enter text mode and trigger sniffString.

I suppose we could add a check so it only runs sniffString on strings starting with http:// or https://, but I don’t like being that specific in the clipboard code. Maybe sniffString could be modified to have two modes (and one wouldn’t be as thorough).

@skurfer skurfer added a commit to skurfer/Quicksilver that referenced this issue Mar 28, 2012

@skurfer skurfer Merge pull request #776 from pjrobertson/fix775
Add NSStringPboardType of URLs to clipboard. Fixes #775
50e4a4b
Owner

pjrobertson commented Mar 28, 2012

I think using different sniffString methods wouldn't work, it'd just be a pain and cause confusion/inconsistency.

I'll have a play with disabling sniffString for clipboard objects all together and see if I encounter any problems.

Owner

skurfer commented Mar 28, 2012

I'll have a play with disabling sniffString for clipboard objects all together and see if I encounter any problems.

Sounds good. I’ve been thinking a lot about sniffString and how it could be augmented by plug-ins, but that’s another topic.

Owner

pjrobertson commented Mar 28, 2012

Sounds good. Ive been thinking a lot about sniffString and how it
could be augmented by plug-ins, but thats another topic.

We should also probably move things to put the most common things first
like you suggested. I think I'll forget about my calculate sniffString
change.

On 28 March 2012 15:34, Rob McBroom <
reply@reply.github.com

wrote:

I'll have a play with disabling sniffString for clipboard objects all
together and see if I encounter any problems.

Sounds good. Ive been thinking a lot about sniffString and how it could
be augmented by plug-ins, but thats another topic.


Reply to this email directly or view it on GitHub:
#775 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment