Skip to content

Commit

Permalink
Fixes #18526: Pasting data from clipboard inside Python console cause…
Browse files Browse the repository at this point in the history
…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 3a5fb9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/console/console_sci.py
Expand Up @@ -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"""
Expand Down Expand Up @@ -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]:
Expand Down

0 comments on commit 3a5fb9d

Please sign in to comment.