diff options
author | aycabta <aycabta@gmail.com> | 2020-11-02 14:48:44 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2020-12-05 02:58:58 +0900 |
commit | faf8f216be034a575350c7f3387992930b224bfc (patch) | |
tree | 80b7619be8eb0561cdbda37b37b46aa987145f83 /lib/reline | |
parent | 564aadce626ff8dc94784d909d2a9c7bcd27b427 (diff) | |
download | ruby-faf8f216be034a575350c7f3387992930b224bfc.tar.gz |
[ruby/reline] Keep operator proc as a local variable in the scope
The proc variable will be used later so the instance variable will be changes.
https://github.com/ruby/reline/commit/496c4361f6
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/line_editor.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index fde8ad928f..17fabd175d 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -706,12 +706,13 @@ class Reline::LineEditor else old_waiting_proc = @waiting_proc old_waiting_operator_proc = @waiting_operator_proc + current_waiting_operator_proc = @waiting_operator_proc @waiting_proc = proc { |k| old_cursor, old_byte_pointer = @cursor, @byte_pointer old_waiting_proc.(k) cursor_diff, byte_pointer_diff = @cursor - old_cursor, @byte_pointer - old_byte_pointer @cursor, @byte_pointer = old_cursor, old_byte_pointer - @waiting_operator_proc.(cursor_diff, byte_pointer_diff) + current_waiting_operator_proc.(cursor_diff, byte_pointer_diff) @waiting_operator_proc = old_waiting_operator_proc } end |