Skip to content
Permalink
Browse files

Fixes #18526: Pasting data from clipboard inside Python console cause…

…s the text cursor to be moved to the end of the row
  • Loading branch information
slarosa committed Mar 23, 2018
1 parent bc45258 commit 3a5fb9d7bd1ca8aa6a4ddbbf051314b79e7153f4
Showing with 3 additions and 2 deletions.
  1. +3 −2 python/console/console_sci.py
@@ -244,7 +244,7 @@ def getTextLength(self):
def get_end_pos(self):
"""Return (line, index) position of the last character"""
line = self.lines() - 1
return (line, len(self.text(line)))
return line, len(self.text(line))

def is_cursor_at_end(self):
"""Return True if cursor is at the end of text"""
@@ -560,8 +560,9 @@ def insertFromDropPaste(self, textDP):
if pasteList[-1] != "":
line = pasteList[-1]
cleanLine = line.replace(">>> ", "").replace("... ", "")
curpos = self.getCursorPosition()
self.insert(cleanLine)
self.move_cursor_to_end()
self.setCursorPosition(curpos[0], curpos[1] + len(cleanLine))

def insertTextFromFile(self, listOpenFile):
for line in listOpenFile[:-1]:

0 comments on commit 3a5fb9d

Please sign in to comment.
You can’t perform that action at this time.