(https://github.com/ruby/reline/pull/759)
* Remove garbage(nil) from Reline::Unicode.split_by_width result
* Remove unused width from Reline::Unicode vi_ ed_ em_ method return value
* Remove unused height from Unicode.split_by_width return value
* Rename split_by_width to split_line_by_width and add legacy split_by_width for IRB
f32446ebc4
* test_yamatanooroti: close tempfile before unlink
* test_yamatanooroti: omit because of windows does not support job control
* test_yamatanooroti: change startup message detection for windows
* windows.rb: can call win32api using nil as NULL for pointer argument
Exception occurred when interrupted with Ctrl+C on legacy conhost
* windows.rb: fix get_screen_size
return [window height, buffer width] insted of [buffer height, buffer width]
* windows.rb: import scroll_down() from ansi.rb
* windows.rb: add auto linewrap control if VT output not supported (legacy console)
* unfreeze WIN32API pointer arguments
They internally duplicate arguments so api functions write to another place.
This breaks the console mode detection with ruby-head.
* remove useless code from Win32API#call
argument repacking and return value tweaking is not needed for Reline::Windows requirements.
* Correctly handle top of console viewport
* Revert "remove useless code from Win32API#call"
This reverts commit 060ba140ed.
* Revert "windows.rb: can call win32api using nil as NULL for pointer argument"
This reverts commit 93a23bc5d0.
47c1ffbabe
(https://github.com/ruby/reline/pull/742)
* Fix redisplay/insert_text called from pre_input_hook
* Rename insert_pasted_text to insert_multiline_text
It is now used from Reline.insert_text which is not inserting pasted text
694a540939
(https://github.com/ruby/reline/pull/712)
* Add key binding matching status :matching_matched
* Simplify read_2nd_character
* Add a comment of matching status and EOF
* Matching status to a constant
* Expand complicated ternary operators to case-when
64deec100b
to the end of the line when there is no search substr
(https://github.com/ruby/reline/pull/714)
* In ed_search_prev_history, make the cursor come to the end of the line when there is no search substr
* In ed_search_next_history, make the cursor come to the end of the line when there is no search substr
* Implemented ActionState to search with empty substr if the previous operation was search with empty string.
* Use a simple 2-element array to represent action_state
95ee80bd70
(https://github.com/ruby/reline/pull/709)
* Improve key binding match/matching check
* Rename key_actors to default_key_bindings
* Make key_stroke.expand always return a value
* Update add_default_key_binding to use a add_default_key_binding_by_keymap internally
Co-authored-by: Stan Lo <stan001212@gmail.com>
---------
353ec236e2
Co-authored-by: Stan Lo <stan001212@gmail.com>
(https://github.com/ruby/reline/pull/707)
* Implement the redo command
* Commented out a test that does not pass
* Changed key assignment for redo from "\C-[" to "\C-g"
* Changed redo key assignment from `\C-g` to `\M-\C-_`
* Revert the first implemantation
* Implemented redo by sharing `@past_lines` between undo and redo
* Fixed the index of past_lines that is updated when the cursor is moved
* Fixed deletion of the redo history in regular input
* Renamed variables: past_lines -> input_lines
* Rename @position to @input_lines_position
* Deleted unused variables: `@old_byte_pointer` and `@old_line_index`
0b2d9fab5f
(https://github.com/ruby/reline/pull/652)
* Separate prompt and input line in rendering
Often, only one of prompt and input changes.
Split prompt+input_line to a separate rendering item will improve differential rendering performance.
* Rename method wrapped_prompt_lines to more descriptive name
16d82f1f23
(https://github.com/ruby/reline/pull/653)
* Support multiline input in Reline.readline internally, reduce multiline-singleline branch
* Add readline(singleline) prompt test with force inserting multiline text
97846095d7
(https://github.com/ruby/reline/pull/649)
* Fix waiting_proc precedence
* Fix waiting_operator bugs
* Add waiting_proc and vi_waiting_operator test
* Fix vi waiting operator arg number
vi_arg and vi_waiting_operator_arg should be multiplied
* Implement `yy` copies whole line in vi_command mode
* Simplify incremental search cancel test
* Add complex vi test with waiting_proc and vi_waiting_operator, split test input
777dffae1c
navigation
(https://github.com/ruby/reline/pull/677)
Fixes https://github.com/ruby/reline/pull/675
This commit extracts the upward navigation condition in `LineEditor#input_key` to a new private method, and adds a new alias. This change allows Reline to support upward navigation in when a user has configured `inputrc` to map Shift-Tab to `menu-complete-backward`, a common setting in Bash (>= 4.x).
Instead of special-casing upward navigation in `LineEditor#input_key`, we now allow it to be processed by the branch that calls `process_key`. The extracted method no longer includes the editing mode check since this check is already made by `#wrap_method_call` by the time `#completion_journey_up` (or `#menu_complete_backward`) is called. Since upward navigation is happening in a method other than `#input_key` now, the `completion_occurs` variable that used to be local to `#input_key` is changed to an instance variable so that the new method can change its value. (I see many examples of mutating such instance variables in `LineEditor`, so I assumed this would be an uncontroversial change consistent with the coding practices already in place.)
Test coverage of this change has been added to the emacs and vi `KeyActor` tests.
Many thanks to @ima1zumi for their very helpful comments on #675 which encouraged me to contribute this work!
2ccdb374a4