File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed
Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ def loadini(struct, configfile):
5353 'hist_length' : 100 ,
5454 'hist_duplicates' : True ,
5555 'paste_time' : 0.02 ,
56+ 'single_undo_time' : 1.0 ,
5657 'syntax' : True ,
5758 'tab_length' : 4 ,
5859 'pastebin_confirm' : True ,
@@ -141,6 +142,7 @@ def get_key_no_doublebind(command):
141142 struct .syntax = config .getboolean ('general' , 'syntax' )
142143 struct .arg_spec = config .getboolean ('general' , 'arg_spec' )
143144 struct .paste_time = config .getfloat ('general' , 'paste_time' )
145+ struct .single_undo_time = config .getfloat ('general' , 'single_undo_time' )
144146 struct .highlight_show_source = config .getboolean ('general' ,
145147 'highlight_show_source' )
146148 struct .hist_file = config .get ('general' , 'hist_file' )
Original file line number Diff line number Diff line change @@ -825,8 +825,8 @@ def insert_into_history(self, s):
825825
826826 def prompt_undo (self ):
827827 """Returns how many lines to undo, 0 means don't undo"""
828- self .config .single_undo_time = 1
829- if self .interp .timer .estimate () < self .config .single_undo_time :
828+ if ( self .config .single_undo_time < 0 or
829+ self .interp .timer .estimate () < self .config .single_undo_time ) :
830830 return 1
831831 est = self .interp .timer .estimate ()
832832 n = self .interact .file_prompt (
Original file line number Diff line number Diff line change 4848# bpython’s behalf. If unset, bpython uploads pastes to bpaste.net. (default: )
4949#pastebin_helper = gist.py
5050
51+ # How long an undo must be expected to take before prompting for how
52+ # many lines should be undone. Set to -1 to never prompt, or 0 to
53+ # always prompt.
54+ # single_undo_time = 1.0
55+
5156[keyboard]
5257
5358# All key bindings are shown commented out with their default binding
Original file line number Diff line number Diff line change @@ -120,6 +120,15 @@ following helper program can be used to create `gists
120120
121121 .. versionadded :: 0.12
122122
123+
124+ single_undo_time
125+ ^^^^^^^^^^^^^^^^
126+ Time duration an undo must be predicted to take before prompting
127+ to undo multiple lines at once. Use -1 to never prompt, or 0 to always prompt.
128+ (default: 1.0)
129+
130+ .. versionadded :: 0.14
131+
123132.. _configuration_color_scheme :
124133
125134color_scheme
You can’t perform that action at this time.
0 commit comments