Commit graph

650 commits

Author SHA1 Message Date
aycabta
db0d850d4e [ruby/reline] Add ed_search_next_history
ca750b676b
2020-04-18 23:12:52 +09:00
aycabta
bea3e31e5f [ruby/reline] Add ed_search_prev_history
e9ae288825
2020-04-18 23:12:52 +09:00
aycabta
08c1c3f220 [ruby/reline] Use vi_search_{prev,next} to incremental search
cab312f584
2020-04-18 23:09:31 +09:00
aycabta
afe997857e [ruby/reline] Rename search_history with incremental_search_history
d563063ea0
2020-04-18 23:09:31 +09:00
aycabta
90913bfabe [ruby/reline] Suppress error in case INPUTRC env is empty
bce7e7562b
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
12ae7b3369 [ruby/reline] Version 0.1.3
ea2b182466
2020-02-15 21:52:03 +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
97b583d68b [ruby/reline] Organize special keys escape sequences
41deb1a3d9
2020-02-09 02:54:41 +09:00
aycabta
06c37fa5b4 [ruby/reline] Bypass cursor down when a char is rendered at eol on Windows
A newline is automatically inserted if a character is rendered at eol on
Windows command prompt.

4bfea07e4a
2020-02-02 03:28:20 +09:00
aycabta
16d4774da1 [ruby/reline] Fix Reline::Windows#scroll_down
I mistook Right and Bottom.

8be401c5f5
2020-02-02 03:28:07 +09:00
aycabta
5d124a3b68 [ruby/reline] Support GNOME style Home/End key sequences [Bug #16510]
788f0df845
2020-01-29 15:11:59 +09:00
aycabta
c257d81186 Always use UTF-8 for Reline::GeneralIO on Windows 2020-01-26 12:57:13 +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
2943ebd240 [ruby/reline] Implement vi_change_meta
8538e0e10f
2020-01-21 09:52:32 +09:00
aycabta
3b407abe9b [ruby/reline] Implement vi_prev_char and vi_to_prev_char
0ad3ee63fa
2020-01-20 19:13:19 +09:00
aycabta
b17797a694 [ruby/reline] Implement vi_to_next_char
066ecb0a21
2020-01-20 19:13:19 +09:00
aycabta
800c2a8e4c Implement vi_insert_at_bol and vi_add_at_eol 2020-01-17 01:37:01 +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
aycabta
7392083c2f Support history-size in .inputrc correctly 2020-01-06 21:50:48 +09:00
aycabta
439e1ccd08 Complete indented and quoted string correctly
def foo
    ''.upca[TAB]

This will be completed to be:

  def foo
  ''.upcase

The indent was gone. This commit fixes the bug.
2020-01-06 01:20:24 +09:00
aycabta
da028a4fbf Rescue EOFError
If C-d is pressed before IRB is ready, IRB crashes because EOFError occurs.
2020-01-05 22:48:39 +09:00
KOBAYASHI Shuji
9b928fa443 [ruby/reline] Sort completion list
#### Legacy mode:

  ```console
  $ irb --legacy
  irb(main):001:0> l[TAB][TAB]
  lambda           load             local_variables  loop
  ```

#### Before this patch:

  ```console
  $ irb
  irb(main):001:0> l[TAB][TAB]
  local_variables
  loop
  lambda
  load
  ```

#### After this patch:

  ```console
  $ irb
  irb(main):001:0> l[TAB][TAB]
  lambda
  load
  local_variables
  loop
  ```

6074069c7d
2020-01-05 11:28:01 +09:00
Yusuke Endoh
337ba56aff [ruby/reline] Degenerate the terminal size to [$LINES, $COLUMNS] if it is unknown
This is a workaround for https://github.com/ruby/irb/issues/50

5725677d1a
2019-12-31 23:32:24 +09:00
aycabta
778634f778 Drop an invalid char as UTF-8 2019-12-27 16:02:30 +09:00
aycabta
e1e1d92277 [ruby/reline] Version 0.1.2
b41024e317
2019-12-25 18:47:47 +09:00
aycabta
8a705245e5 Save last breaking point to complete 2019-12-25 18:45:24 +09:00
aycabta
2462427008 [ruby/reline] Version 0.1.1
923f97d068
2019-12-25 10:08:39 +09:00
aycabta
ed5b4bae6a The behavior of vi_end_of_transmission should be the same of vi_list_or_eof 2019-12-25 09:52:37 +09:00
aycabta
622e47a1db ^D on non-empty line in vi mode behaves like Enter 2019-12-25 09:34:13 +09:00
aycabta
7758849cb5 Remove unused variable 2019-12-24 18:39:48 +09:00
aycabta
42e2a322f1 The delete-char-or-list shows completed list when called at end of line
It doesn't behave the same as the delete-char.
2019-12-24 18:34:43 +09:00
aycabta
5e17834fc9 [ruby/reline] Version 0.1.0
55d4dfec1e
2019-12-24 09:56:40 +09:00
Nobuyoshi Nakada
679bc4f9cb [ruby/reline] Use IO#raw to read one byte
be17740e82
2019-12-23 02:11:22 +09:00
Nobuyoshi Nakada
efd4a11ada Support multibyte input 2019-12-22 11:46:43 +09:00
Yusuke Endoh
fa1bf8ab37 [ruby/reline] Support Ctrl+right as em_next_word, and Ctrl+left as ed_prev_word
e98ad3b486
2019-12-22 05:35:03 +09:00
aycabta
0835a971ef Remove TODO comment 2019-12-22 01:57:35 +09:00
Yusuke Endoh
ec1de789a9 [ruby/reline] Preserve the input buffer across cursor_pos
The old version of cursor_pos discards the input buffer, which made IRB
ignore the input immediately after IRB is invoked.

This change keeps the input before cursor_pos by using ungetc.

4a8cca331f
2019-12-22 01:57:35 +09:00
Nobuyoshi Nakada
7fd6077d98 [ruby/reline] Consider Reline::ANSI.input at prep
b111cde3c3
2019-12-22 01:57:35 +09:00
Nobuyoshi Nakada
e68999c82c
Fixed misspellings
Fixed misspellings reported at [Bug #16437], for default gems.
2019-12-20 12:19:45 +09:00
aycabta
d616926af9 Remove an unnecessary variable 2019-12-17 14:21:07 +09:00
aycabta
4f9a4c1a8f Remove unnecessary branches 2019-12-17 13:59:19 +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
Nobuyoshi Nakada
11db4d3a3b [ruby/reline] Disable any implementation-defined special control characters
Including dsusp, lnext, and so on.

a44abe586b
2019-12-17 13:19:37 +09:00
aycabta
618d091151 Support change search direction 2019-12-17 13:10:39 +09:00
aycabta
a14a0244b4 Support forward-search-history by C-s 2019-12-17 13:07:19 +09:00
aycabta
c2dfc6d869 Show a menu before a document
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.
2019-12-13 08:54:22 +09:00
aycabta
7d991a0571 Suppress to crash IRB if completed list has nil 2019-12-12 08:40:50 +09:00
aycabta
6a7af800db Add a message for CompatibilityError 2019-12-11 11:36:40 +09:00
aycabta
ec54ac9381 Support Readline.completion_quote_character by Reline 2019-12-11 11:13:05 +09:00