@@ -973,6 +973,7 @@ def wrap_method_call(method_symbol, method_obj, key, with_operator = false)
973973 @drop_terminate_spaces = false
974974 end
975975
976+ ARGUMENT_DIGIT_METHODS = %i[ ed_digit vi_zero ed_argument_digit ]
976977 VI_WAITING_ACCEPT_METHODS = %i[ vi_change_meta vi_delete_meta vi_yank ed_insert ed_argument_digit ]
977978
978979 private def process_key ( key , method_symbol )
@@ -1004,7 +1005,7 @@ def wrap_method_call(method_symbol, method_obj, key, with_operator = false)
10041005 method_obj = method ( method_symbol )
10051006 end
10061007 if @vi_arg
1007- if key . match? ( / \A \d \z / )
1008+ if ARGUMENT_DIGIT_METHODS . include? ( method_symbol )
10081009 ed_argument_digit ( key )
10091010 else
10101011 if argumentable? ( method_obj )
@@ -1015,9 +1016,7 @@ def wrap_method_call(method_symbol, method_obj, key, with_operator = false)
10151016 wrap_method_call ( method_symbol , method_obj , key )
10161017 end
10171018 @kill_ring . process
1018- if @vi_arg
1019- @vi_arg = nil
1020- end
1019+ @vi_arg = nil
10211020 end
10221021 elsif method_obj
10231022 if method_symbol == :ed_argument_digit
@@ -1227,15 +1226,13 @@ def confirm_multiline_termination
12271226 end
12281227
12291228 def insert_multiline_text ( text )
1230- save_old_buffer
12311229 pre = @buffer_of_lines [ @line_index ] . byteslice ( 0 , @byte_pointer )
12321230 post = @buffer_of_lines [ @line_index ] . byteslice ( @byte_pointer ..)
12331231 lines = ( pre + Reline ::Unicode . safe_encode ( text , encoding ) . gsub ( /\r \n ?/ , "\n " ) + post ) . split ( "\n " , -1 )
12341232 lines << '' if lines . empty?
12351233 @buffer_of_lines [ @line_index , 1 ] = lines
12361234 @line_index += lines . size - 1
12371235 @byte_pointer = @buffer_of_lines [ @line_index ] . bytesize - post . bytesize
1238- push_input_lines
12391236 end
12401237
12411238 def insert_text ( text )
@@ -1419,20 +1416,16 @@ def finish
14191416 alias_method :ed_digit , :ed_insert
14201417 alias_method :self_insert , :ed_insert
14211418
1422- private def ed_quoted_insert ( str , arg : 1 )
1423- @waiting_proc = proc { |key |
1424- arg . times do
1425- if key == "\C -j" or key == "\C -m"
1426- key_newline ( key )
1427- elsif key != "\0 "
1428- # Ignore NUL.
1429- ed_insert ( key )
1430- end
1419+ private def insert_raw_char ( str , arg : 1 )
1420+ arg . times do
1421+ if str == "\C -j" or str == "\C -m"
1422+ key_newline ( str )
1423+ elsif str != "\0 "
1424+ # Ignore NUL.
1425+ ed_insert ( str )
14311426 end
1432- @waiting_proc = nil
1433- }
1427+ end
14341428 end
1435- alias_method :quoted_insert , :ed_quoted_insert
14361429
14371430 private def ed_next_char ( key , arg : 1 )
14381431 byte_size = Reline ::Unicode . get_next_mbchar_size ( current_line , @byte_pointer )
0 commit comments