add option to leave review on keypress and on screen change
This commit is contained in:
parent
cea7824b3d
commit
2d77b626dc
@ -134,6 +134,10 @@ highlight=False
|
||||
[review]
|
||||
lineBreak=True
|
||||
endOfScreen=True
|
||||
# leave the review when pressing a key
|
||||
leaveReviewOnKeypress=False
|
||||
# leave the review when changing the screen
|
||||
leaveReviewOnScreenChange=True
|
||||
|
||||
[promote]
|
||||
enabled=True
|
||||
|
@ -137,6 +137,10 @@ highlight=False
|
||||
[review]
|
||||
lineBreak=True
|
||||
endOfScreen=True
|
||||
# leave the review when pressing a key
|
||||
leaveReviewOnKeypress=False
|
||||
# leave the review when changing the screen
|
||||
leaveReviewOnScreenChange=True
|
||||
|
||||
[promote]
|
||||
enabled=True
|
||||
|
@ -136,6 +136,10 @@ highlight=False
|
||||
[review]
|
||||
lineBreak=True
|
||||
endOfScreen=True
|
||||
# leave the review when pressing a key
|
||||
leaveReviewOnKeypress=False
|
||||
# leave the review when changing the screen
|
||||
leaveReviewOnScreenChange=True
|
||||
|
||||
[promote]
|
||||
enabled=True
|
||||
|
@ -87,6 +87,10 @@ highlight=False
|
||||
[review]
|
||||
lineBreak=True
|
||||
endOfScreen=True
|
||||
# leave the review when pressing a key
|
||||
leaveReviewOnKeypress=False
|
||||
# leave the review when changing the screen
|
||||
leaveReviewOnScreenChange=True
|
||||
|
||||
[promote]
|
||||
enabled=True
|
||||
|
32
src/fenrir/commands/onInput/11000-leave_review_mode.py
Normal file
32
src/fenrir/commands/onInput/11000-leave_review_mode.py
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Fenrir TTY screen reader
|
||||
# By Chrys, Storm Dragon, and contributers.
|
||||
|
||||
from core import debug
|
||||
|
||||
class command():
|
||||
def __init__(self):
|
||||
pass
|
||||
def initialize(self, environment):
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def getDescription(self):
|
||||
return 'No Description found'
|
||||
|
||||
def run(self):
|
||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnKeypress'):
|
||||
return
|
||||
if self.env['runtime']['inputManager'].noKeyPressed():
|
||||
return
|
||||
if self.env['runtime']['screenManager'].isScreenChange():
|
||||
return
|
||||
if len(self.env['input']['prevDeepestInput']) > len(self.env['input']['currInput']):
|
||||
return
|
||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||
|
||||
def setCallback(self, callback):
|
||||
pass
|
||||
|
@ -17,6 +17,8 @@ class command():
|
||||
return 'No Description found'
|
||||
|
||||
def run(self):
|
||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('review', 'leaveReviewOnScreenChange'):
|
||||
return
|
||||
self.env['runtime']['cursorManager'].clearReviewCursor()
|
||||
|
||||
def setCallback(self, callback):
|
@ -65,6 +65,8 @@ settings = {
|
||||
'review':{
|
||||
'lineBreak': True,
|
||||
'endOfScreen': True,
|
||||
'leaveReviewOnKeypress': False,
|
||||
'leaveReviewOnScreenChange': True,
|
||||
},
|
||||
'promote':{
|
||||
'enabled': True,
|
||||
|
Loading…
Reference in New Issue
Block a user