@@ -1191,7 +1191,7 @@ def detach_window(self, *args):
11911191 'Choose a tab to move the window to' ,
11921192 ''
11931193 ]
1194- fmt = '{} { }'
1194+ fmt = ': {1 }'
11951195 tab_id_map = {}
11961196 current_tab = self .active_tab
11971197 for i , tab in enumerate (self .all_tabs ):
@@ -1206,7 +1206,7 @@ def detach_window(self, *args):
12061206 lines .append (fmt .format (new_idx , 'New OS Window' ))
12071207
12081208 def done (data , target_window_id , self ):
1209- done .tab_id = tab_id_map [int (data ['match ' ][0 ]. strip (). partition ( ' ' )[ 0 ]) ]
1209+ done .tab_id = tab_id_map [int (data ['groupdicts ' ][0 ][ 'index' ]) + 1 ]
12101210
12111211 def done2 (target_window_id , self ):
12121212 if not hasattr (done , 'tab_id' ):
@@ -1223,8 +1223,11 @@ def done2(target_window_id, self):
12231223 self ._move_window_to (window = target_window , target_tab_id = tab_id )
12241224
12251225 self ._run_kitten (
1226- 'hints' , args = ('--ascending' , '--type=regex' , r'--regex=(?m)^\s*\d+ .+$' ,),
1227- input_data = '\r \n ' .join (lines ).encode ('utf-8' ), custom_callback = done , action_on_removal = done2 )
1226+ 'hints' , args = (
1227+ '--ascending' , '--customize-processing=::import::kitty.choose_entry' ,
1228+ r'--regex=(?m)^:\s+.+$' ,
1229+ ), input_data = '\r \n ' .join (lines ).encode ('utf-8' ), custom_callback = done , action_on_removal = done2
1230+ )
12281231
12291232 def detach_tab (self , * args ):
12301233 if not args or args [0 ] == 'new' :
@@ -1234,16 +1237,17 @@ def detach_tab(self, *args):
12341237 'Choose an OS window to move the tab to' ,
12351238 ''
12361239 ]
1240+ fmt = ': {1}'
12371241 os_window_id_map = {}
12381242 current_os_window = getattr (self .active_tab , 'os_window_id' , 0 )
12391243 for i , osw in enumerate (self .os_window_map ):
12401244 tm = self .os_window_map [osw ]
12411245 if current_os_window != osw and tm .active_tab and tm .active_tab :
12421246 os_window_id_map [i + 1 ] = osw
1243- lines .append ('{} {}' .format (i + 1 , tm .active_tab .title ))
1247+ lines .append (fmt .format (i + 1 , tm .active_tab .title ))
12441248 new_idx = len (os_window_id_map ) + 1
12451249 os_window_id_map [new_idx ] = None
1246- lines .append ('{} {}' .format (new_idx , 'New OS Window' ))
1250+ lines .append (fmt .format (new_idx , 'New OS Window' ))
12471251
12481252 def done (data , target_window_id , self ):
12491253 done .os_window_id = os_window_id_map [int (data ['match' ][0 ].partition (' ' )[0 ])]
@@ -1262,5 +1266,8 @@ def done2(target_window_id, self):
12621266 self ._move_tab_to (tab = target_tab , target_os_window_id = os_window_id )
12631267
12641268 self ._run_kitten (
1265- 'hints' , args = ('--ascending' , '--type=regex' , r'--regex=(?m)^\d+ .+$' ,),
1266- input_data = '\r \n ' .join (lines ).encode ('utf-8' ), custom_callback = done , action_on_removal = done2 )
1269+ 'hints' , args = (
1270+ '--ascending' , '--customize-processing=::import::kitty.choose_entry' ,
1271+ r'--regex=(?m)^:\s+.+$' ,
1272+ ), input_data = '\r \n ' .join (lines ).encode ('utf-8' ), custom_callback = done , action_on_removal = done2
1273+ )
0 commit comments