Improved rstrip for copy.

This commit is contained in:
Storm Dragon 2020-03-07 07:28:30 -05:00
parent 48427c247c
commit 5b5536444d

View File

@ -18,7 +18,9 @@ class command():
return _('copies last presented text to the clipboard') return _('copies last presented text to the clipboard')
def run(self): def run(self):
lastEcho = self.env['runtime']['outputManager'].getLastEcho().rstrip() lastEcho = self.env['runtime']['outputManager'].getLastEcho()
if lastEcho.rstrip() != "":
lastEcho = lastEcho.rstrip()
self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', lastEcho) self.env['runtime']['memoryManager'].addValueToFirstIndex('clipboardHistory', lastEcho)
self.env['runtime']['outputManager'].presentText(lastEcho, soundIcon='CopyToClipboard', interrupt=True) self.env['runtime']['outputManager'].presentText(lastEcho, soundIcon='CopyToClipboard', interrupt=True)