make beep work with empty line

This commit is contained in:
Chrys 2021-05-19 21:52:06 +02:00
parent 37dad53325
commit 4502f8321a

View File

@ -28,7 +28,9 @@ class command():
# is a vertical change? # is a vertical change?
if not self.env['runtime']['cursorManager'].isCursorHorizontalMove(): if not self.env['runtime']['cursorManager'].isCursorHorizontalMove():
return return
currIdent, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText']) x, y, currLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['newContentText'])
currIdent = self.env['screen']['newCursor']['x']
if not currLine.isspace(): if not currLine.isspace():
# ident # ident
lastIdent, lastY, lastLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['oldContentText']) lastIdent, lastY, lastLine = line_utils.getCurrentLine(self.env['screen']['newCursor']['x'], self.env['screen']['newCursor']['y'], self.env['screen']['oldContentText'])
@ -49,7 +51,6 @@ class command():
if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]: if self.env['runtime']['settingsManager'].getSettingAsInt('general', 'autoPresentIndentMode') in [0,2]:
if self.lastIdent != currIdent: if self.lastIdent != currIdent:
self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=False, flush=False) self.env['runtime']['outputManager'].presentText(_('indented ') + str(currIdent) + ' ', interrupt=False, flush=False)
self.lastIdent = currIdent self.lastIdent = currIdent
def setCallback(self, callback): def setCallback(self, callback):
pass pass