Commit graph

75 commits

Author SHA1 Message Date
aycabta
68a7c8ad57 Reline callbacks can take nil 2020-05-14 12:27:33 +09:00
aycabta
69cd27c98e [ruby/reline] Suppress error when check ambiguous char width in LANG=C
623dffdd75
2020-03-26 17:41:21 +09:00
aycabta
f245fb1ab8 [ruby/reline] Work with wrong $/ value correctly
962ebf5a1b
2020-03-26 17:41:21 +09:00
aycabta
2efb38e766 [ruby/reline] Use IO#write instead of IO#print
IO#print always adds a string of $\ automatically.

a93119c847
2020-02-14 22:47:27 +09:00
aycabta
8f4beec152 Always refer to Reline::IOGate.encoding 2020-01-26 12:50:11 +09:00
Lars Kanis
d1166c6d39 Reline: Use a more robust detection of MinTTY
The previous detection per get_screen_size fails when stdout is passed
to a pipe. That is the case when running ruby tests in parallel ("-j" switch).
In this case Reline believes that it's running on MinTTY and the tests
are running with ANSI IOGate instead of the Windows adapter on MINGW.
So parallel test results were different to that of a single process.
This commit fixes these differencies.

The code is taken from git sources and translated to ruby.
NtQueryObject() is replaced by GetFileInformationByHandleEx(), because
NtQueryObject() is undocumented and is more difficult to use:
  c5a03b1e29/compat/winansi.c (L558)
2020-01-21 21:26:58 +09:00
aycabta
f8ea2860b0 Introduce an abstracted structure about the encoding of Reline
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.
2020-01-14 15:40:38 +09:00
Thomas Leitner
a1713bedb1 [ruby/reline] Implement completion_append_character
There is already the possibility to set Reline.completion_append_character.
However, it is not used by the line editor.

ab798931b9
2019-12-17 13:19:37 +09:00
aycabta
ec54ac9381 Support Readline.completion_quote_character by Reline 2019-12-11 11:13:05 +09:00
aycabta
6a22b2a091 Support completion with case-insensitive fashion
Reline performs completion in a case-insensitive fashon if
Readline.completion_case_fold or completion-ignore-case of .inputrc are set
"on".
2019-12-10 07:07:43 +09:00
aycabta
a92560132b Support incremental search by last determined word
In the incremental search by C-r, search word is saved when it's determined. In
the next incremental search by C-r, if a user presses C-r again with the empty
search word, the determined previous search word is used to search.
2019-12-03 01:39:59 +09:00
manga_osyo
6723aa07e5 Change argument Proc to #call defined object.
This is the same as the behavior of Readline.
2019-11-21 00:47:37 +09:00
aycabta
633625a083 Mintty on Cygwin isn't a kind of command prompt, can process ANSI escape code 2019-11-20 17:55:19 +09:00
osyo-manga
fe45bee093 Reline#readline and Reline#readmultiline to private. 2019-11-12 21:03:22 +09:00
aycabta
6e72b72881 Suppress "shadowing outer local variable" warning in 2.5 2019-11-08 16:18:36 +09:00
Jeremy Evans
c4b627e2da Only taint on Ruby <2.7
Ruby 2.7 deprecates taint and it no longer has an effect.
2019-11-05 20:57:22 +09:00
Jeremy Evans
d6ed7a984c Fix verbose warning being emitted
Fixes Ruby Bug 16281.
2019-10-31 17:51:50 +09:00
Lars Kanis
551edf64bc Reline: Fix wrong variable name
This raised a NameError before.
2019-09-09 19:16:01 +09:00
aycabta
744be55fad Remove duplicated delegation 2019-08-27 06:30:32 +09:00
aycabta
fd0a4a64a3 Delegete an instance method to a class method correctly 2019-08-27 05:59:56 +09:00
aycabta
f13db4adde Save value to @ambiguous_width because of a accessor 2019-08-27 05:33:27 +09:00
aycabta
f2a5c50f94 The "private" doesn't make sence for class methods and a constant 2019-08-27 05:18:51 +09:00
aycabta
68207bb4fc Use preposing "private" to define methods 2019-08-27 05:18:51 +09:00
aycabta
d8bcede9c3 Adjust method forwardings of Reline 2019-08-27 05:18:46 +09:00
manga_osyo
344f507e4e Remove .freeze. 2019-08-27 01:23:50 +09:00
manga_osyo
195f545c14 Fix Reline::Windows. 2019-08-27 01:23:24 +09:00
manga_osyo
298ac04710 Refactoring Reline. 2019-08-27 01:23:19 +09:00
manga_osyo
f60e5a1f99 Remove test_mode in lib/reline. 2019-08-27 01:23:10 +09:00
Charles Oliver Nutter
842364792f Use host_os from RbConfig to detect host OS.
RUBY_PLATFORM on JRuby is always "java", so it will not reflect
the host operating system. This regex appears to be the consensus
way to detect Windows based on a search of Ruby code on Github:

https://github.com/search?q=%2Fmswin%7Cmsys%7Cmingw%7Ccygwin%7Cbccwin%7Cwince%7Cemc%2F&type=Code
2019-08-06 20:03:23 +09:00
manga_osyo
073cc52dcc Add class Reline::History and test. 2019-07-15 00:17:59 +09:00
aycabta
71ead07872 Add arg check to Reline.dig_perfect_match_proc= 2019-07-11 17:21:00 +09:00
aycabta
32e65e9e5a Print starting debug message with RELINE_STDERR_TTY 2019-06-18 21:58:05 +09:00
aycabta
235e72f17e Implement auto indent for multiline 2019-06-18 20:58:18 +09:00
aycabta
9402d019a5 Remove debug print 2019-06-14 08:45:52 +09:00
aycabta
64310b2573 Add Reline.prompt_proc 2019-06-14 07:42:53 +09:00
aycabta
c75a3356b3 Move I/O access from Reline::KeyStroke to Reline 2019-06-05 11:29:59 +09:00
aycabta
486a2c26d6 Add Reline test for unknown macro 2019-06-02 08:50:01 +09:00
aycabta
e360688c4d Add new test for Reline within pipe 2019-06-02 07:39:12 +09:00
aycabta
bfd26cc18d Reline.readmultiline always needs block to confirm termination 2019-06-02 07:21:59 +09:00
aycabta
7df65ef676 Use inputrc data for keystroke setting 2019-06-01 09:06:27 +09:00
Nobuyoshi Nakada
552c42f51f
Seprate raw keystroke config for each platforms 2019-06-01 00:41:17 +09:00
aycabta
88770c2ab6 Support Home and End key to move to beg and end 2019-06-01 00:02:35 +09:00
aycabta
21a43489b1 Use IO#sync= instead of a monkey patch 2019-05-31 22:53:01 +09:00
aycabta
73890d9d79 Flush I/O immediately if RELINE_STDERR_TTY is set 2019-05-31 22:33:08 +09:00
aycabta
3f13297923 Remove extra items because Reline::HISTORY is a sized queue 2019-05-29 10:04:58 +09:00
Takashi Kokubun
98ba116d40
Revert 3b7862c8e8 causing various CI hangs
and dependent commits c67934b1c3 and
f0d1dc5cee.

RubyCI and ci.rvm.jp are almost dead by timeout since this commit.

---

Revert "Skip a reline test hanging on Wercker since 3b7862c8e8"

This reverts commit f0d1dc5cee.

Revert "Remove extra items because Reline::HISTORY is a sized queue"

This reverts commit c67934b1c3.

Revert "Use existing instances for LineEditor and Config"

This reverts commit 3b7862c8e8.
2019-05-29 09:05:26 +09:00
aycabta
c67934b1c3 Remove extra items because Reline::HISTORY is a sized queue 2019-05-29 05:58:33 +09:00
aycabta
3b7862c8e8 Use existing instances for LineEditor and Config 2019-05-29 05:53:44 +09:00
aycabta
57b4df07bc Use Reline.completer_quote_characters to complete 2019-05-28 08:38:55 +09:00
aycabta
1d301acbe8 Fix rendering bug of ^D 2019-05-27 10:09:21 +09:00