diff --git a/src/fenrir/commands/commands/copy_marked_to_clipboard.py b/src/fenrir/commands/commands/copy_marked_to_clipboard.py index 1f6aee86..36d96d3e 100644 --- a/src/fenrir/commands/commands/copy_marked_to_clipboard.py +++ b/src/fenrir/commands/commands/copy_marked_to_clipboard.py @@ -18,10 +18,12 @@ class command(): return 'copies marked text to the currently selected clipboard' def run(self): - if not (self.env['commandBuffer']['Marks']['1'] and \ - self.env['commandBuffer']['Marks']['2']): - self.env['runtime']['outputManager'].presentText("two marks needed", interrupt=True) + if not self.env['commandBuffer']['Marks']['1']: + self.env['runtime']['outputManager'].presentText("one or two marks needed", interrupt=True) return + if not self.env['commandBuffer']['Marks']['2']: + self.env['runtime']['cursorManager'].setMark() + # use the last first and the last setted mark as range startMark = self.env['commandBuffer']['Marks']['1'].copy() endMark = self.env['commandBuffer']['Marks']['2'].copy() diff --git a/src/fenrir/core/cursorManager.py b/src/fenrir/core/cursorManager.py index 4d384ef4..32d4cd2f 100644 --- a/src/fenrir/core/cursorManager.py +++ b/src/fenrir/core/cursorManager.py @@ -25,11 +25,16 @@ class cursorManager(): return self.env['commandBuffer']['Marks']['1'] != None and \ self.env['commandBuffer']['Marks']['2'] != None def setMark(self): + currCursor = None + if self.env['screenData']['newCursorReview']: + currCursor = self.env['screenData']['newCursorReview'].copy() + else: + currCursor = self.env['screenData']['newCursor'].copy() if not self.env['commandBuffer']['Marks']['1']: - self.env['commandBuffer']['Marks']['1'] = self.env['screenData']['newCursorReview'].copy() + self.env['commandBuffer']['Marks']['1'] = currCursor.copy() return 1 else: - self.env['commandBuffer']['Marks']['2'] = self.env['screenData']['newCursorReview'].copy() + self.env['commandBuffer']['Marks']['2'] = currCursor.copy() return 2 return 0 def getReviewOrTextCursor(self):