@@ -679,7 +679,11 @@ const Editor = Module("editor", {
679679
680680 mappings . add ( [ modes . INSERT ] ,
681681 [ "<C-t>" ] , "Edit text field in Vi mode" ,
682- function ( ) { liberator . mode = modes . TEXTAREA ; } ) ;
682+ function ( ) {
683+ let edtr = Editor . getEditor ( ) ;
684+ edtr . setSelectionRange ( edtr . selectionStart - 1 , edtr . selectionStart - 1 ) ;
685+ liberator . mode = modes . TEXTAREA ;
686+ } ) ;
683687
684688 mappings . add ( [ modes . INSERT ] ,
685689 [ "<Space>" , "<Return>" ] , "Expand insert mode abbreviation" ,
@@ -812,7 +816,7 @@ const Editor = Module("editor", {
812816 function ( count , arg ) {
813817 let pos = editor . findCharForward ( arg , count ) ;
814818 if ( pos >= 0 )
815- editor . moveToPosition ( pos , true , liberator . mode == modes . VISUAL ) ;
819+ editor . moveToPosition ( pos - 1 , true , liberator . mode == modes . VISUAL ) ;
816820 } ,
817821 { arg : true , count : true } ) ;
818822
@@ -830,7 +834,7 @@ const Editor = Module("editor", {
830834 function ( count , arg ) {
831835 let pos = editor . findCharForward ( arg , count ) ;
832836 if ( pos >= 0 )
833- editor . moveToPosition ( pos - 1 , true , liberator . mode == modes . VISUAL ) ;
837+ editor . moveToPosition ( pos - 2 , true , liberator . mode == modes . VISUAL ) ;
834838 } ,
835839 { arg : true , count : true } ) ;
836840
0 commit comments