@@ -195,7 +195,7 @@ def reset_variables(prompt = '', encoding:)
195
195
@searching_prompt = nil
196
196
@first_char = true
197
197
@add_newline_to_end_of_buffer = false
198
- @just_cursor_moving = false
198
+ @just_cursor_moving = nil
199
199
@cached_prompt_list = nil
200
200
@prompt_cache_time = nil
201
201
@eof = false
@@ -244,6 +244,7 @@ def multiline_off
244
244
@buffer_of_lines . insert ( @line_index + 1 , String . new ( next_line , encoding : @encoding ) )
245
245
@previous_line_index = @line_index
246
246
@line_index += 1
247
+ @just_cursor_moving = false
247
248
end
248
249
249
250
private def calculate_height_by_width ( width )
@@ -921,6 +922,7 @@ def wrap_method_call(method_symbol, method_obj, key, with_operator = false)
921
922
end
922
923
923
924
def input_key ( key )
925
+ @just_cursor_moving = nil
924
926
if key . char . nil?
925
927
if @first_char
926
928
@line = nil
@@ -956,12 +958,16 @@ def input_key(key)
956
958
unless completion_occurs
957
959
@completion_state = CompletionState ::NORMAL
958
960
end
959
- unless Reline ::IOGate . in_pasting?
961
+ if not Reline ::IOGate . in_pasting? and @just_cursor_moving . nil ?
960
962
if @previous_line_index and @buffer_of_lines [ @previous_line_index ] == @line
961
963
@just_cursor_moving = true
962
964
elsif @previous_line_index . nil? and @buffer_of_lines [ @line_index ] == @line
963
965
@just_cursor_moving = true
966
+ else
967
+ @just_cursor_moving = false
964
968
end
969
+ else
970
+ @just_cursor_moving = false
965
971
end
966
972
if @is_multiline and @auto_indent_proc and not simplified_rendering?
967
973
process_auto_indent
0 commit comments