start fixing word wrapping

This commit is contained in:
chrys 2016-12-13 00:02:29 +01:00
parent 40169f9b25
commit 8aa22fcafd

View File

@ -5,8 +5,8 @@
# By Chrys, Storm Dragon, and contributers.
from core import debug
# X Y Word END
# -1, -1, '', True
# X Y Word END BREAK
# -1, -1, '', True False
def getPrevWord(currX,currY, currText):
lineBreak = False
endOfScreen = False
@ -16,6 +16,7 @@ def getPrevWord(currX,currY, currText):
if endOfScreen:
return x, y, currWord, endOfScreen, lineBreak
wrappedLines = currText.split('\n')
currLine = wrappedLines[y].replace("\t"," ")
return x, y, currWord, endOfScreen, lineBreak
def getCurrentWord(currX,currY, currText):
@ -25,8 +26,8 @@ def getCurrentWord(currX,currY, currText):
return -1, -1, '', endOfScreen, lineBreak
x = currX
y = currY
wrappedLines = currText.split('\n')
currWord = ''
wrappedLines = currText.split('\n')
currLine = wrappedLines[y].replace("\t"," ")
return x, y, currWord, endOfScreen, lineBreak
@ -35,9 +36,9 @@ def getNextWord(currX,currY, currText):
endOfScreen = False
if currText == '':
return -1, -1, '', endOfScreen, lineBreak
x = currX
y = currY
x, y, currWord, endOfScreen, lineBreak = getCurrentWord(currX,currY,currText)
if endOfScreen:
return x, y, currWord, endOfScreen, lineBreak
wrappedLines = currText.split('\n')
currWord = ''
currLine = wrappedLines[y].replace("\t"," ")
return x, y, currWord, endOfScreen, lineBreak