File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,7 @@ enum EditorMode {
239239 Insert ,
240240 Replace ,
241241 Command ,
242+ InsertNext ,
242243}
243244
244245pub struct CommandError ;
@@ -759,6 +760,7 @@ impl ViEditor {
759760 b'\x04' => return Ok ( Action :: Eof ) ,
760761 b'\x16' => {
761762 // ^V
763+ self . mode = EditorMode :: InsertNext ;
762764 }
763765 b'\x17' => { }
764766 other if !other. is_ascii_control ( ) => {
@@ -792,6 +794,15 @@ impl ViEditor {
792794 }
793795 }
794796 }
797+ EditorMode :: InsertNext => {
798+ if self . cursor . position < self . edit_line . len ( ) {
799+ self . edit_line . insert ( self . cursor . position , c) ;
800+ } else {
801+ self . edit_line . push ( c) ;
802+ }
803+ self . cursor . position += 1 ;
804+ self . mode = EditorMode :: Insert ;
805+ }
795806 }
796807 Ok ( Action :: None )
797808 }
You can’t perform that action at this time.
0 commit comments