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>
[Feature #20205]
Now that chilled strings no longer appear as frozen, there is no
need to offer an API to check for chilled strings.
We however need to change `rb_check_frozen_internal` to no
longer be a macro, as it needs to check for chilled strings.
The keyword argument `anonymous` is implemented for `Tempfile.create`
The default is `anonymous: false`.
The behavior is not changed as before.
The created temporary file is immediately removed if `anonymous: true` is specified.
So applications don't need to remove the file.
The actual storage of the file is reclaimed by the OS when the file is closed.
It uses `O_TMPFILE` for Linux 3.11 or later.
It creates an anonymous file from the beginning.
It uses FILE_SHARE_DELETE for Windows.
It makes it possible to remove the opened file.
[Feature #20497]
Previously, ensure ISEQs took their first line number from the
line number coming from the AST. However, if this is coming from
an empty `begin`..`end` inside of a method, this can be all of the
way back to the method declaration. Instead, this commit changes
it to be the first line number of the ensure block itself.
The first_lineno field is only accessible through manual ISEQ
compilation or through tracepoint. Either way, this will be more
accurate for targeting going forward.
They were initially made frozen to avoid false positives for cases such
as:
str = str.dup if str.frozen?
But this may cause bugs and is generally confusing for users.
[Feature #20205]
Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
This test randomly fails due to the bug reported in [Bug #20314], where
the two timeouts are too close so that they can expire at the same time.
As a workaround, this change increases the time difference between
timeouts. This will reduce the probability of simultaneous expirations
and lower flakiness.
(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
Since `IO.new` accepts one or two positional arguments except for the
optional hash argument, exclude the optional hash argument from the
check for delegation to `IO.new`.
In some cases Prism was either not raising an appropriate `void value
expression` error, or raising that error when the syntax is considered
valid.
To fix this Prism needs to check whether we have other clauses on the
`begin` rather than just returning `cast->statements`.
* If the `cast->statements` are null and the `cast->ensure_clause` is
not null, set the code to `cast->ensure_clause`
* else
* If there is a `cast->rescue_clause`
* Check if `cast->statements` are null and `cast->rescue_clause->statements`
are null, and return `NULL`
* Check if there is an `else_clause`, and set the node to
`cast->else_clause`.
* Otherwise return `cast->statements` as the node
* return `cast->statements` as the node
See tests for test cases. Note I took these directly from CRuby so if
desired I can delete them since the test will now pass. This only fixes
one test in the `test_parse` file, taking failures from 14 to 13.
This fixes `TestParse#test_void_value_in_rhs` and is related to
issue #2791.
https://github.com/ruby/prism/commit/398152b412