Age | Commit message (Collapse) | Author |
|
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
https://github.com/ruby/reline/commit/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>
---------
https://github.com/ruby/reline/commit/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`
https://github.com/ruby/reline/commit/0b2d9fab5f
|
|
(https://github.com/ruby/reline/pull/701)
* Refactor send
* Implement the undo command
* Fix @past_lines initialization
* Improve assertion
* Hide to save buffer in insert_pasted_text
* Replace @using_delete_command with @undoing
* Refactor `@past_lines`
https://github.com/ruby/reline/commit/4ab72f9cbd
|
|
bindings C-i C-p C-n
(https://github.com/ruby/reline/pull/698)
https://github.com/ruby/reline/commit/1314787bbb
|
|
(https://github.com/ruby/reline/pull/681)
https://github.com/ruby/reline/commit/501b9a6c5f
|
|
(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
https://github.com/ruby/reline/commit/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!
https://github.com/ruby/reline/commit/2ccdb374a4
|
|
because clear(C-l) is not a signal
(https://github.com/ruby/reline/pull/646)
https://github.com/ruby/reline/commit/3debb0ae2f
|
|
(https://github.com/ruby/reline/pull/645)
* Add assertion assert_cursor_line to test helper
* Autofix key_actor test to use assert_cursor_line
* Rename the assertion to assert_line_around_cursor and remove other assertions for line and cursor
https://github.com/ruby/reline/commit/e4773800c6
|
|
(https://github.com/ruby/reline/pull/614)
* Re-architecture LineEditor's internal state and rendering
* Fix test related to LineEditor re-architecture
* Bump to 0.5.0.pre.1
* Hide cursor only when updating screen. Frequent hide&show makes cursor flickering.
* Simplify rerender call from reline.rb
* Simplify handle_cleared
It only need to clear screen. line_editor.rerender will be called later.
* Add description of updating pasting_state inserts continuous_insertion_buffer
* Use meaningful block parameter
Co-authored-by: Stan Lo <stan001212@gmail.com>
* Fix use of `@cursor_y`
Fix bug updating `@cursor_y`. Do not use `@cursor_y` while updating dialog because it is not current cursor position but cursor position at last rendered time.
* Remove useless instance_variable_set in test
These instance variables are already removed from LineEditor
* Always initialize instance variables to avoid ruby 2.7 warning, remove unused instance variable
* Call update_dialogs from reline.rb before first render
* Combine state representing rendered screen information into `@rendered_screen`
* Rename editor_cursor_ to wrapped_cursor
It represents cursor position of word wrapped whole content
* Remove unused code, tweak, add comment
---------
https://github.com/ruby/reline/commit/3fa376217d
Co-authored-by: Stan Lo <stan001212@gmail.com>
|
|
(https://github.com/ruby/reline/pull/566)
* Avoid referencing IOGate from IOGate classes
The only time those classes being used is when themselves being the IOGate.
So when referencing to IOGate, it's better to use `self` instead.
* Avoid referencing to IOGate from LineEditor directly
* Avoid referencing to IOGate from Core directly
* Reference to Reline.core directly
* Replace Reline::IOGate with Reline.core.io_gate
|
|
* Test existing behavior
Typing Ctrl-D ends editing but typing <Del> does not.
Also renamed a test that is not testing ed_delete_next_char but
key_delete.
* Check if line empty first in em_delete
By distributivity of AND over OR, we can factor out this condition. This
will make the next commit simpler.
* Use em_delete in key_delete
When the editing mode is emacs, use `em_delete` in `key_delete`. We need
to add a condition though to `em_delete`, because it implements both
`delete-char` and `end-of-file`. We only want the `end-of-file` behavior
is the key is really Ctrl-D.
This matches the behavior of the <Del> key with readline, i.e. deleting
the next character if there is one, but not moving the cursor, while not
finishing the editing if there are no characters.
|
|
The kill-line was called when C-u was entered, so it is now called unix-line-discard.
In readline(3):
> unix-line-discard (C-u)
> Kill backward from point to the beginning of the line.
> The killed text is saved on the kill-ring.
https://github.com/ruby/reline/commit/27570d195e
|
|
https://github.com/ruby/reline/commit/9fca6ceb45
|
|
https://github.com/ruby/reline/commit/9ab99574f5
|
|
on Windows
The method "input_keys" in test/reline/helper.rb handles a single-byte
and 8-bit charater as an input with the meta key.
However, "test_halfwidth_kana_width_dakuten" in test/reline/test_key_actor_emacs.rb
uses a string that contains "hankaku" characters.
A "hankaku" character is not with the meta key, but it is a single-byte
and 8-bit character on Windows-31J encoding, which confused "input_keys"
method. This caused the following error.
https://ci.appveyor.com/project/ruby/ruby/builds/41997092/job/ejm77qxgvnlpdwvg
```
1) Failure:
Reline::KeyActor::Emacs::Test#test_halfwidth_kana_width_dakuten [C:/projects/ruby/test/reline/test_key_actor_emacs.rb:2311]:
<"\xB6\xDE\xB7\xDE\xB9\xDE\xBA\xDE" (#<Encoding:Windows-31J>)> expected but was
<"\e^\e^\e^\e:\e^" (#<Encoding:Windows-31J>)> in <Terminal #<Encoding:Windows-31J>>
.
<8> expected but was
<10>.
Finished tests in 1045.472722s, 19.3922 tests/s, 2609.4320 assertions/s.
```
This change introduces "input_raw_keys" that does not convert a
single-byte and 8-bit character to "with the meta key", and use it in
the test in question.
https://github.com/ruby/reline/commit/f6ae0e5d19
|
|
https://github.com/ruby/reline/commit/0895a0d4a1
|
|
The vi mode can handle "argument number" before an operator or a motion,
such as, "3x" (equals "xxx"), and "3l" (equals "lll"). In the emacs
mode, GNU Readline can handle argument number with meta key, like
"Meta+3 x" (equals "xxx").
https://github.com/ruby/reline/commit/9183cc2e8b
|
|
https://github.com/ruby/reline/commit/43b7c01a98
|
|
https://github.com/ruby/reline/commit/9b1913567a
|
|
https://github.com/ruby/reline/commit/940cdaa301
|
|
I'm so sorry, the previous revert was just a mistake.
This reverts commit 9103c3ba8bc09f287f69ca322f58faa34e003f2e.
|
|
This reverts commit 491591c7cee842601118efc2698e0e41283827b3.
|
|
For ruby/ruby repository's AppVeyor CI (Windows environment), `Reline::IOGate.encoding` will be changed from `UTF-8` to `Windows-31J` after the test is run.
So, when `test/reline/test_key_actor_emacs.rb` is loaded, `Reline::IOGate.encoding == Encoding::UTF_8` will be `true`,
but at the time of test execution, `Reline::IOGate.encoding` is `Windows-31J`.
For this reason, I changed the test method to check `Reline::IOGate.encoding` in the test method.
https://github.com/ruby/reline/commit/10e1ce3320
|
|
|
|
|
|
https://github.com/ruby/reline/commit/5354d02e03
|
|
This fixes ruby/reline#261.
https://github.com/ruby/reline/commit/3cf1213014
|
|
The current line was being handled incorrectly when displaying the hit
history, so it has been fixed to be correct.
https://github.com/ruby/reline/commit/a3df4343b3
|
|
https://github.com/ruby/reline/commit/a7922da16b
|
|
This closes ruby/reline#106.
https://github.com/ruby/reline/commit/2549a52e15
|
|
https://github.com/ruby/reline/commit/3c74beac65
|
|
|
|
https://github.com/ruby/reline/commit/f21dfdbb11
|
|
https://github.com/ruby/reline/commit/abb56e5ec3
|
|
https://github.com/ruby/reline/commit/2dabf0c786
|
|
https://github.com/ruby/reline/commit/ca750b676b
|
|
https://github.com/ruby/reline/commit/e9ae288825
|
|
https://github.com/ruby/reline/commit/8480db575b
|
|
https://github.com/ruby/reline/commit/f4eac8c76f
|
|
https://github.com/ruby/reline/commit/962ebf5a1b
|
|
The command prompt on Windows always uses Unicode to take input and print
output but most Reline implementation depends on Encoding.default_external.
This commit introduces an abstracted structure about the encoding of Reline.
|
|
def foo
''.upca[TAB]
This will be completed to be:
def foo
''.upcase
The indent was gone. This commit fixes the bug.
|
|
This is for 8a705245e55575d4d310a2e956b89a36a5931971.
|
|
It doesn't behave the same as the delete-char.
|
|
|
|
|
|
IRB should show a menu first if a completed list has plural items. But just
shows document without menu if a completed list with plural items includes a
perfect matched item. The behavior is a bug. This commit fixes it.
|
|
|