Граф коммитов

672 Коммитов

Автор SHA1 Сообщение Дата
Stan Lo 33e00b79a0 [ruby/reline] Bump version to 0.3.6
(https://github.com/ruby/reline/pull/565)

https://github.com/ruby/reline/commit/2503ddb9a6
2023-07-08 08:53:46 +00:00
tomoya ishida 02f9b685e8 [ruby/reline] Ignore unhandled escape sequences
(https://github.com/ruby/reline/pull/522)

* Add unassigned escape sequence matcher to KeyStroke

* Do not insert ESC and unassigned ESC+key to input buffer
2023-07-08 08:41:30 +00:00
Stan Lo 24d9e21f84 [ruby/reline] Reduce direct references to `Reline::IOGate`
(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
2023-07-07 17:27:25 +00:00
tomoya ishida cd7166cc8f [ruby/reline] Fix wrong byte_pointer passed to auto_indent_proc
(https://github.com/ruby/reline/pull/562)

https://github.com/ruby/reline/commit/4348354604
2023-07-05 16:33:46 +00:00
ima1zumi 218a8d8ef1 [ruby/reline] Remove unused method
(https://github.com/ruby/reline/pull/557)

`get_mbchar_byte_size_by_first_char` isn't used in Reline.
Also, this method implements the same functionality as `String#bytesize` and is unnecessary.
2023-06-22 17:07:23 +00:00
Yuta Kusuno 9ce6e09637 [ruby/reline] Omit constant under Struct
(https://github.com/ruby/reline/pull/554)

https://github.com/ruby/reline/commit/8761a11fa5
2023-06-20 14:02:58 +00:00
Stan Lo e6bd1852fb [ruby/reline] Bump version to 0.3.5
(https://github.com/ruby/reline/pull/548)

https://github.com/ruby/reline/commit/4330a52572
2023-06-03 08:28:02 +00:00
Nobuyoshi Nakada e38fb050fa [ruby/reline] Remove unnecessary conditions for
`Fiddle::TYPE_VARIADIC`
(https://github.com/ruby/reline/pull/547)

https://github.com/ruby/reline/commit/71ba3a9432
2023-06-02 12:18:06 +00:00
tomoya ishida cf0b9e0db0 [ruby/reline] Fix scrolldown condition in dialog rendering
(https://github.com/ruby/reline/pull/541)

https://github.com/ruby/reline/commit/ad6faada3f
2023-05-27 15:07:29 +00:00
tomoya ishida 5d137a7f77 [ruby/reline] Use appropriate dialog height and reduce screen pushup
problem
(https://github.com/ruby/reline/pull/542)

* Provide preferred_dialog_height for dialog positioning

* Fix rendering test
2023-05-27 14:48:50 +00:00
ima1zumi 8db13c179e [ruby/reline] Bump version to 0.3.4
(https://github.com/ruby/reline/pull/538)

https://github.com/ruby/reline/commit/1fb0753bc1
2023-05-20 09:31:43 +00:00
tomoya ishida 5eca327fc5 [ruby/reline] Fix dialog corrupts rendering by pushing up input line
too much
(https://github.com/ruby/reline/pull/524)

* Do not render dialog where it overflows screen

* Dialog rendering should Scroll down only when needed

* Refactor screen_y_range calculation

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

https://github.com/ruby/reline/commit/bc0e3d1310

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-05-07 13:18:13 +00:00
tomoya ishida 13dfbcf7bf [ruby/reline] Rewrite dialog rendering
(https://github.com/ruby/reline/pull/492)

* Rewrite dialog rendering

* Fix failing test of dialog with small screen

* Add multiple-dialog rendering test

* Add description comments for each part of render_dialog_changes
2023-05-01 12:20:20 +00:00
Carl Brasic 8a132358d7 [ruby/reline] Revert #335 (Trap TSTP to handle C-z)
(https://github.com/ruby/reline/pull/535)

This PR was an effort to address #321 (ed_quoted_insert doesn't work
properly) but per the reporter it did not work correctly.

Moreover, it introduced a major regression: Shell job control stopped
working in all applications that use reline, notably IRB.

Bash and other shells send SIGTSTP in response to C-z to implement job
suspension. Handling SIGSTP opts out of this functionality. For a
line oriented terminal program this should be avoided (not to mention,
this behavior diverges from readline's)

https://github.com/ruby/reline/commit/26383d25b8

Co-authored-by: Carl Brasic <cbrasic@drwholdings.com>
2023-04-24 16:31:13 +00:00
Étienne Barrié 52ff2ce9da
Use `em_delete` in `key_delete` (#504)
* 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.
2023-04-05 08:59:12 +09:00
Stan Lo b168141c78 [ruby/reline] Drop Dialog#scrollbar_pos as we can store it in a
local variable
(https://github.com/ruby/reline/pull/529)

https://github.com/ruby/reline/commit/d0139975fd

Co-authored-by: tomoya ishida <tomoyapenguin@gmail.com>
2023-03-29 13:51:27 +00:00
Stan Lo 02ecdf85c5 [ruby/reline] Drop Unicode.take_range's optional arg as it's never
used
(https://github.com/ruby/reline/pull/528)

https://github.com/ruby/reline/commit/428fed4a6a
2023-03-29 10:20:29 +00:00
tomoya ishida e26908dc4b [ruby/reline] Improve OSC sequence regexp. OSC sequence can end with
ST(ESC\) and it should not to include \a and \e inside.
(https://github.com/ruby/reline/pull/527)

https://github.com/ruby/reline/commit/a88052adec
2023-03-29 06:54:08 +00:00
Stan Lo 1e9a218ade [ruby/reline] Expand the scanned array to later case statement more
straightforward
(https://github.com/ruby/reline/pull/526)

* Improve test coverage on Unicode.take_range

* Add test for Unicode.calculate_width

* Expand the scanned array to later case statement more straightforward
2023-03-28 12:49:49 +00:00
ima1zumi ec14b381c1 [ruby/reline] Bump version to 0.3.3
(https://github.com/ruby/reline/pull/525)

https://github.com/ruby/reline/commit/8ce176271f
2023-03-27 15:14:56 +00:00
tomoya ishida 8f569d41cb [ruby/reline] Fix cursor position overrun
(https://github.com/ruby/reline/pull/515)

* Fix cursor position overrun

* Remove unnecessary local variable

Co-authored-by: Stan Lo <stan001212@gmail.com>

---------

https://github.com/ruby/reline/commit/d4ad9b96c8

Co-authored-by: Stan Lo <stan001212@gmail.com>
2023-03-27 13:57:16 +00:00
tomoya ishida 60ca800d4f [ruby/reline] Fix split_by_width to retain color sequences
(https://github.com/ruby/reline/pull/490)

* Fix split_by_width to retain color sequences

* Add OSC escape sequence testcase of Reline::Unicode.split_by_width
2023-03-25 15:01:35 +00:00
Phillip Hellewell f67f0d7268 [ruby/reline] Add key bindings for PgUp and PgDn
(https://github.com/ruby/reline/pull/509)

* Add key bindings for PgUp, PgDn

* Match behavior of readline 8.2

In the latest readline (8.2), page-up and page-down are bound to
history-search-backward and history-search-forward by default.

We would like reline to have the same default behavior.
2023-03-21 14:48:32 +00:00
tomoya ishida e8e7ff1333 [ruby/reline] Fix: line longer than terminal width breaks rendering
(https://github.com/ruby/reline/pull/516)

https://github.com/ruby/reline/commit/ae5f9b87ab
2023-03-18 14:37:10 +00:00
tomoya ishida 6f81e38d1d [ruby/reline] Fix completion with multiline
(https://github.com/ruby/reline/pull/513)

https://github.com/ruby/reline/commit/d76c482c5f
2023-03-04 05:56:00 +00:00
tomoya ishida 4f611df3f7 [ruby/reline] Fix wrong indent number in prompt. whole_lines has
duplicated line.
(https://github.com/ruby/reline/pull/460)

* whole_lines should consider prev_line_index, and must not duplicate last_line

* Add test for lines passed to dynamic prompt proc

* Refactor whole_lines parameters used in test helper

* Remove whole_line's arguments
2023-02-27 10:21:30 +00:00
tomoya ishida 92ed8e6f3f [ruby/reline] Fix the cause of test_yamatanooroti randomly failing
(https://github.com/ruby/reline/pull/474)

* Add repeated input-delete test that fails on HEAD

* Use raw mode while readmultiline
2023-02-27 08:44:02 +00:00
tompng 91f353b1c3 [ruby/reline] Fix line rendering when newline is added at the end of the buffer
https://github.com/ruby/reline/commit/7d61b3df9a
2023-02-06 14:23:59 +00:00
Étienne Barrié 70eedef32a [ruby/reline] Splat is always an Array
https://github.com/ruby/reline/commit/82095bd62b
2023-01-31 09:33:49 +09:00
Hiroshi SHIBATA eb2670e32d [ruby/reline] Revert "correct Win32API capitalization for JRuby"
This reverts commit https://github.com/ruby/reline/commit/d6e7c9e1d9af.

https://github.com/ruby/reline/commit/c47a5b684c
2023-01-26 04:27:52 +00:00
tompng 4241b3cf2d [ruby/reline] accept new_indent > cursor_max
https://github.com/ruby/reline/commit/61cc580da4
2023-01-20 13:40:15 +00:00
tompng 8e53f09baa [ruby/reline] Add constant MINIMUM_SCROLLBAR_HEIGHT for scrollbar rendering when dialog content is very long
https://github.com/ruby/reline/commit/d4c95f89ec
2023-01-18 14:49:29 +00:00
tompng a712f2a2a0 [ruby/reline] Fix dialog scrollbar rendering position and disappearing bug
https://github.com/ruby/reline/commit/e21b69ade4
2023-01-18 14:49:28 +00:00
elfham aa66595876 [ruby/reline] Update to Unicode 15.0.0
(https://github.com/ruby/reline/pull/437)

* Update to Unicode 14.0.0

* Update to Unicode 15.0.0
2023-01-12 09:40:34 +00:00
tomoya ishida 0abb4b6348 [ruby/reline] Pass unmodifined lines(that does not include escape
sequence) to check_multiline_prompt
(https://github.com/ruby/reline/pull/458)

* pass unmodified lines to check_multiline_prompt

* Add test to check that output modified by output_modifier_proc is not passed to prompt_proc
2023-01-12 00:14:53 +00:00
Phillip Hellewell 97f8f2c470 [ruby/reline] Add key binding for Delete
https://github.com/ruby/reline/commit/603eacee22
2023-01-10 12:18:14 +00:00
Joel Anderson e25c173c97 [ruby/reline] correct Win32API capitalization for JRuby
JRuby 9.4.0.0 introduced a change in case sensitivity in require statements,
meaning that an inclusion of `win32api` loaded Win32API.rb. With this change,
the require statement needs to be updated to the correct capitalization of the
filename to avoid reline failures in newer versions of JRuby.

https://github.com/ruby/reline/commit/d6e7c9e1d9
2023-01-04 06:32:46 +00:00
Hiroshi SHIBATA 989d993f5b [ruby/reline] Bump version to 0.3.2
https://github.com/ruby/reline/commit/3fbb7ec2ae
2022-12-14 07:01:19 +00:00
Stan Lo 16b2e03014 [ruby/reline] Remove unapproved color setting APIs
These APIs/configs are not approved by the Ruby core, so they can't be
released to the public. This means having them in the codebase will
block other fixes/features from being released as well.

So this commit removes those exposed interfaces to unblock the release.

Hopefully when https://bugs.ruby-lang.org/issues/18996 is approved we
can re-implement better APIs.

https://github.com/ruby/reline/commit/f7a961c550
2022-12-05 03:14:55 +00:00
HASUMI Hitoshi 11871e49c4 [ruby/reline] Fix misuse of kwarg in IO#raw
- Obviously, `tim` is a typo for `time`
- This didn't cause an exception because IO#raw is implemented in C and it doesn't check the keyword of the parameters
- Though this typo doesn't produce any problems for now, I think it should be fixed just in case for the future
- I've used this fixed version of Reline with IRB for several days and didn't find any new problems due to the fix
- But I myself am not sure how to make sure this fix is completely robust

https://github.com/ruby/reline/commit/e66a9696a1
2022-12-02 10:47:18 +00:00
Otávio Schwanck dos Santos 696e8914b7 [ruby/reline] PR changes
https://github.com/ruby/reline/commit/e8e8d81f47
2022-09-22 22:28:38 +09:00
Otávio Schwanck dos Santos 9d19d910c0 [ruby/reline] Revert "update version"
This reverts commit https://github.com/ruby/reline/commit/ce1ac86179e6.

https://github.com/ruby/reline/commit/86602cd244
2022-09-22 22:28:37 +09:00
Otávio Schwanck dos Santos 224a3ea718 [ruby/reline] update version
https://github.com/ruby/reline/commit/ce1ac86179
2022-09-22 22:28:37 +09:00
Otávio Schwanck dos Santos 9fb18e6314 [ruby/reline] fix vi-operator-arg
https://github.com/ruby/reline/commit/d42cdb8f91
2022-09-22 22:28:36 +09:00
Nobuyoshi Nakada 1b8a644b44 [ruby/reline] Fix a typo [ci skip]
https://github.com/ruby/reline/commit/33bf80e757
2022-09-03 03:27:58 +09:00
Hiroshi SHIBATA 0d2422cf63 [ruby/reline] Workaround for padding width with Aracritty on macOS
https://github.com/ruby/reline/commit/fb4136c8a7
2022-09-02 16:09:51 +09:00
Hiroshi SHIBATA 7ff50ee35c [ruby/reline] Added some of abstruct methods for cursor
https://github.com/ruby/reline/commit/f5fa30d595
2022-09-02 16:09:50 +09:00
Mau Magnaguagno 941e9be0d9 [ruby/reline] Remove loose operation in Dialog#render_each_dialog
https://github.com/ruby/reline/commit/a6d1c917ce
2022-09-01 14:01:37 +09:00
st0012 b3be030740 [ruby/reline] Rename dialog_pointer_* to dialog_highlight_*
"Pointer" is not what we usually use to describe a selected item.

"Highlight" is a more common word for the scenario so we should use it instead.

https://github.com/ruby/reline/commit/b4279d1557
2022-07-22 23:34:49 +09:00
st0012 36ca0e58b6 [ruby/reline] Use color name instead of code (integer) in dialog color APIs
As pointed out in the
[comment](https://github.com/ruby/reline/pull/413#issuecomment-1168033973),
the code is actually a control sequence and not only for colors.

To make the dialog color APIs safer to use, we should restrict its
usages and extract away the bg/fg concept from the input.

So in this commit, I made these changes:

1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol):
  - :black
  - :red
  - :green
  - :yellow
  - :blue
  - :magenta
  - :cyan
  - :white
2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code.

https://github.com/ruby/reline/commit/b32a977766
2022-07-16 02:30:23 +09:00