Fix broken :yank

This commit is contained in:
Florian Bruhin 2014-05-18 08:14:11 +02:00
parent 578a58145c
commit d643d6ce44

View File

@ -345,6 +345,20 @@ class CommandDispatcher(QObject):
def yank(self, sel=False):
"""Yank the current URL to the clipboard or primary selection.
Args:
sel: True to use primary selection, False to use clipboard
"""
clip = QApplication.clipboard()
url = urlutils.urlstring(self._tabs.currentWidget().url())
mode = QClipboard.Selection if sel else QClipboard.Clipboard
clip.setText(url, mode)
message.info("URL yanked to {}".format("primary selection" if sel
else "clipboard"))
@cmdutils.register(instance='mainwindow.tabs.cmd')
def yank_title(self, sel=False):
"""Yank the current title to the clipboard or primary selection.
Args:
sel: True to use primary selection, False to use clipboard
"""