add initial barrier function and fix history

This commit is contained in:
chrys
2018-06-10 14:44:54 +02:00
parent 8ba049ff1f
commit 9b87a34ab0
11 changed files with 20 additions and 65 deletions

View File

@ -33,10 +33,10 @@ class command():
return
x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
if currLine.isspace():
self.env['runtime']['outputManager'].presentText(_("blank"), soundIcon='EmptyLine', interrupt=True, flush=False)
else:
# ident
currIdent = len(currLine) - len(currLine.lstrip())
if self.lastIdent == -1:
self.lastIdent = currIdent
@ -44,8 +44,13 @@ class command():
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'autoPresentIndent'):
if self.lastIdent != currIdent:
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=doInterrupt, flush=False)
doInterrupt = False
self.env['runtime']['outputManager'].presentText(currLine, interrupt=doInterrupt, flush=False)
doInterrupt = False
# barrier
sayLine = currLine
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'barrier'):
sayLine = self.env['runtime']['textManager'].getBarrierText(sayLine, self.env['screen']['newCursor']['x'])
# output
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
self.lastIdent = currIdent
def setCallback(self, callback):
pass

View File

@ -24,8 +24,7 @@ class command():
return
# hack for pdmenu and maybe other dialog apps that place the cursor at last cell/row
# this is not to be identified as history
if self.env['screen']['newCursor']['x'] == == self.env['runtime']['screenManager'].getColums() - 1 and\
self.env['screen']['newCursor']['y'] == self.env['runtime']['screenManager'].getRows() - 1):
if (self.env['screen']['newCursor']['x'] == self.env['runtime']['screenManager'].getColumns() - 1) and (self.env['screen']['newCursor']['y'] == self.env['runtime']['screenManager'].getRows() - 1):
return
if self.env['runtime']['inputManager'].getShortcutType() in ['KEY']:
if not (self.env['runtime']['inputManager'].getLastDeepestInput() in [['KEY_UP'],['KEY_DOWN']]):