File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -346,6 +346,9 @@ impl Vim {
346346 ) ;
347347 }
348348 } ) ;
349+
350+ // Drop back to normal mode after yanking
351+ self . switch_mode ( Mode :: HelixNormal , true , window, cx) ;
349352 }
350353
351354 fn helix_insert ( & mut self , _: & HelixInsert , window : & mut Window , cx : & mut Context < Self > ) {
@@ -842,7 +845,16 @@ mod test {
842845 cx. simulate_keystrokes ( "y" ) ;
843846 cx. shared_clipboard ( ) . assert_eq ( "worl" ) ;
844847 cx. assert_state ( "hello «worlˇ»d" , Mode :: HelixNormal ) ;
848+
849+ // Test yanking in select mode character by character
850+ cx. set_state ( "hello ˇworld" , Mode :: HelixNormal ) ;
851+ cx. simulate_keystroke ( "v" ) ;
852+ cx. assert_state ( "hello «wˇ»orld" , Mode :: HelixSelect ) ;
853+ cx. simulate_keystroke ( "y" ) ;
854+ cx. assert_state ( "hello «wˇ»orld" , Mode :: HelixNormal ) ;
855+ cx. shared_clipboard ( ) . assert_eq ( "w" ) ;
845856 }
857+
846858 #[ gpui:: test]
847859 async fn test_shift_r_paste ( cx : & mut gpui:: TestAppContext ) {
848860 let mut cx = VimTestContext :: new ( cx, true ) . await ;
You can’t perform that action at this time.
0 commit comments