Commit graph

20 commits

Author SHA1 Message Date
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
ima1zumi
519a945efc [ruby/reline] Execute compress_meta_key if convert_meta is on
fix `#357`

When using 8-bit characters, it is better not to use `compress_meta_key`.
I believe not to use `compress_meta_key` unless `set convert-meta on` is written in the `.inputrc`.

The following is a quote from tmtm's comments.

> The behavior of this compress_meta_key method is similar to the behavior of convert-meta=on in readline, but readline turns off convert-meta if the locale contains 8bit characters.

> In readline(3):

> convert-meta (On)
> If set to On, readline will convert characters with the eighth
> bit set to an ASCII key sequence by stripping the eighth bit and
> prefixing it with an escape character (in effect, using escape
> as the meta prefix). The default is On, but readline will set
> it to Off if the locale contains eight-bit characters.

9491cc8542

Co-authored-by: TOMITA Masahiro <tommy@tmtm.org>
2021-12-10 22:19:14 +09:00
ima1zumi
616d671758 [ruby/reline] Remove unused using method
follow #347

37453a83a3
2021-09-14 22:28:50 +09:00
aycabta
8de53fb31c [ruby/reline] Use expanded method definitions instead of refinements
@jhawthorn said, "this will make Ruby's integer comparisons slower
globally." It looks like "binding.irb" is going to cause serious
problems in Rails applications.

ee8d6c6a82
2021-09-13 05:15:47 +09:00
aycabta
d07060c42a [ruby/reline] No need to use max_by when array.size == 1
7e56c8af05
2021-09-06 05:23:55 +09:00
aycabta
8913b9b742 [ruby/reline] Use sort.last instead of sort.reverse.first
67f1d8d2d2
2021-09-06 05:23:46 +09:00
aycabta
3773296bfc [ruby/reline] Allow Reline::KeyStroke to compare raw and meta-key processed key sequences
731103f9c9
2021-09-06 05:23:27 +09:00
aycabta
568615d395 [ruby/reline] Use single quotes for non-expanded string literals
3bf7c7d722
2020-08-18 19:08:11 +09:00
aycabta
6e72b72881 Suppress "shadowing outer local variable" warning in 2.5 2019-11-08 16:18:36 +09:00
aycabta
c75a3356b3 Move I/O access from Reline::KeyStroke to Reline 2019-06-05 11:29:59 +09:00
aycabta
7df65ef676 Use inputrc data for keystroke setting 2019-06-01 09:06:27 +09:00
aycabta
19430b776c Fix wrong variable name 2019-05-25 08:24:41 +09:00
aycabta
822468307b Add round-robin variable 2019-05-25 08:08:54 +09:00
aycabta
eb4e774711 Support Meta key in Reline 2019-05-24 23:38:40 +09:00
aycabta
5837290af1 Implement Reline's class methods for compatibility
- insert_text
- redisplay
- line_buffer
- point
- point=
- vi_editing_mode
- emacs_editing_mode
- vi_editing_mode?
- emacs_editing_mode?
- get_screen_size
2019-05-13 02:26:31 +09:00
aycabta
17350c7e55 Add Reline as a fallback library for Readline
* lib/reine.rb, lib/reline/*: Reline is a readline stdlib compatible
  library.
* lib/readline.rb: Readline uses a fallback to Reline when ext/readline
  doesn't exist.
* tool/sync_default_gems.rb: add ruby/reline as a default gem.
* appveyor.yml: add "set RELINE_TEST_ENCODING=Windows-31J" for test suit
  of Reline, and add "--exclude readline" to "nmake test-all" on Visual
  Studio builds because of strange behavior.
* spec/ruby/library/readline/spec_helper.rb: skip Reline as with
  RbReadline.
2019-04-30 11:44:20 +09:00
Nobuyoshi Nakada
f4f66bd11c
Revert "IRB is improved with Reline and RDoc, take 2"
Accidentally merged when 89271d4a37
"Adjusted indents".
2019-04-23 21:55:29 +09:00
aycabta
f2cd4f4cd0
IRB is improved with Reline and RDoc, take 2 2019-04-23 20:08:02 +09:00
aycabta
51cec00953 Revert "IRB is improved with Reline and RDoc"
This reverts commit 7f273ac6d0.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-21 09:13:49 +00:00
aycabta
7f273ac6d0 IRB is improved with Reline and RDoc
Reline is a readline stdlib compatible library. It also supports
multiline input. IRB is improved with Reline and supports multiline.
Besides, supports showing documents when completed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-04-20 08:51:20 +00:00