@@ -679,7 +679,11 @@ const Editor = Module("editor", {
679
679
680
680
mappings . add ( [ modes . INSERT ] ,
681
681
[ "<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
+ } ) ;
683
687
684
688
mappings . add ( [ modes . INSERT ] ,
685
689
[ "<Space>" , "<Return>" ] , "Expand insert mode abbreviation" ,
@@ -812,7 +816,7 @@ const Editor = Module("editor", {
812
816
function ( count , arg ) {
813
817
let pos = editor . findCharForward ( arg , count ) ;
814
818
if ( pos >= 0 )
815
- editor . moveToPosition ( pos , true , liberator . mode == modes . VISUAL ) ;
819
+ editor . moveToPosition ( pos - 1 , true , liberator . mode == modes . VISUAL ) ;
816
820
} ,
817
821
{ arg : true , count : true } ) ;
818
822
@@ -830,7 +834,7 @@ const Editor = Module("editor", {
830
834
function ( count , arg ) {
831
835
let pos = editor . findCharForward ( arg , count ) ;
832
836
if ( pos >= 0 )
833
- editor . moveToPosition ( pos - 1 , true , liberator . mode == modes . VISUAL ) ;
837
+ editor . moveToPosition ( pos - 2 , true , liberator . mode == modes . VISUAL ) ;
834
838
} ,
835
839
{ arg : true , count : true } ) ;
836
840
0 commit comments