polish clipboard stuff

This commit is contained in:
chrys
2016-08-24 00:41:16 +02:00
parent 3f869b65ed
commit eb323eeedf
10 changed files with 36 additions and 67 deletions

View File

@ -15,12 +15,15 @@ def getTextBetweenMarks(firstMark, secondMark, inText):
startY = startMark['y']
textPart = ''
while startY <= endMark['y']:
if startY < endMark['y']:
textPart += inText[startY][startX:]
if len(textPart) - len(textPart[::-1].strip()) > 0:
textPart = textPart[:len(textPart[::-1].strip())] + "\n"
if startMark['y'] == endMark['y']:
textPart += inText[startY][startX:endMark['x'] + 1]
else:
textPart += inText[startY][:startX + 1]
if startY < endMark['y']:
textPart += inText[startY][startX:]
if len(textPart) - len(textPart[::-1].strip()) > 0:
textPart = textPart[:len(textPart[::-1].strip())] + "\n"
else:
textPart += inText[startY][:startX + 1]
startX = 0
startY += 1
return textPart