File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 77class RequestViewInputCommand (RequestInputCommand ): # this command should be overidden, and not used directly
88 """Create an input panel specific to the view that this command was run on (by default, Sublime's API makes it apply to the whole window)."""
99 input_panel_hidden = None
10+ last_selections = None
1011
1112 def parse_args (self ):
1213 super ().parse_args ()
@@ -23,11 +24,16 @@ def show_input_panel(self, initial_value):
2324
2425 def hide_input_panel (self ):
2526 self .input_panel_hidden = True
27+ self .last_selections = [cursor for cursor in self .input_panel .sel ()]
2628 self .close_input_panel ()
2729
2830 def restore_input_panel (self ):
2931 self .current_value = None
3032 self .show_input_panel (self .pending_value )
33+ if self .last_selections is not None :
34+ self .input_panel .sel ().clear ()
35+ self .input_panel .sel ().add_all (self .last_selections )
36+ self .input_panel .window ().focus_view (self .input_panel )
3137
3238 def on_activated_async (self , view ):
3339 if view is None :
You can’t perform that action at this time.
0 commit comments