mirror of
https://github.com/python/cpython.git
synced 2025-10-06 23:21:06 +00:00
bpo-4630: Add cursor no-blink option for IDLE (GH-16960)
This immediately toggles shell, editor, and output windows, but does not affect other input widgets.
This commit is contained in:
parent
2d56af7a94
commit
9c2844927d
7 changed files with 48 additions and 1 deletions
|
@ -241,6 +241,12 @@ class EditorWindow(object):
|
|||
self.indentwidth = self.tabwidth
|
||||
self.set_notabs_indentwidth()
|
||||
|
||||
# Store the current value of the insertofftime now so we can restore
|
||||
# it if needed.
|
||||
if not hasattr(idleConf, 'blink_off_time'):
|
||||
idleConf.blink_off_time = self.text['insertofftime']
|
||||
self.update_cursor_blink()
|
||||
|
||||
# When searching backwards for a reliable place to begin parsing,
|
||||
# first start num_context_lines[0] lines back, then
|
||||
# num_context_lines[1] lines back if that didn't work, and so on.
|
||||
|
@ -803,6 +809,16 @@ class EditorWindow(object):
|
|||
text.mark_set("insert", pos + "+1c")
|
||||
text.see(pos)
|
||||
|
||||
def update_cursor_blink(self):
|
||||
"Update the cursor blink configuration."
|
||||
cursorblink = idleConf.GetOption(
|
||||
'main', 'EditorWindow', 'cursor-blink', type='bool')
|
||||
if not cursorblink:
|
||||
self.text['insertofftime'] = 0
|
||||
else:
|
||||
# Restore the original value
|
||||
self.text['insertofftime'] = idleConf.blink_off_time
|
||||
|
||||
def ResetFont(self):
|
||||
"Update the text widgets' font if it is changed"
|
||||
# Called from configdialog.py
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue