Closed erbridge closed 8 years ago
Why the getter and setter functions? It seems like a standard Go interface might be a better fit, in addition to being simpler.
Probably. Trying not to change too much at once, though, and currently, the frontends choose the clipboard backend to use, and provide the functions.
@ricochet1k Do you think refactoring it into an interface is something that needs to happen before merging this?
I think it makes more sense to make one breaking change, rather than two.
They break different things, but yes, I see the logic.
Better @ricochet1k?
I like the interface implementation, but I don't like how the internal handling of text/autoExpanded is tied to the selected clipboard. Shouldn't the clipboard only be responsible for getting/setting the system clipboard, not remembering internal clipboard stuff?
It's conceivable that one clipboard implementation would manage to store autoExpanded
on the system clipboard itself by structuring the data, allowing that information to be transferred between instances of Lime (e.g. between VMs using shared clipboards), for example.
Alternatively, where would you have Lime remember the internal clipboard stuff?
I'm going to merge this. We can refactor it further later, if we want, but this enables functionality, which I'd like to get in.
LGTM, Also we should change the frontend remove the setting clipboard code.
Also add a flag to track if the current contents was auto-expanded, required for full paste command functionality.
Note this is a breaking change which will stop the commands from working.