Commit graph

350 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
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
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
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
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
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
aycabta
778634f778 Drop an invalid char as UTF-8 2019-12-27 16:02:30 +09:00
aycabta
8a705245e5 Save last breaking point to complete 2019-12-25 18:45:24 +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
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
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
aycabta
fe0df7dcfc Change encoding of completion strings 2019-12-10 17:28:09 +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
a14c01441b Fix encoding compatibility checking of completion correctly 2019-12-09 14:21:20 +09:00
aycabta
e3587ed849 Support disable-completion 2019-12-05 09:02:23 +09:00
aycabta
027e847cd2 Fix auto-indent behavior correctly 2019-12-03 13:02:50 +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
aycabta
103b04128f Support incremental search again by C-r in incremental search 2019-12-02 04:18:22 +09:00
aycabta
c7f05310a2 Process Backspace key in incremental search correctly 2019-12-02 03:30:38 +09:00
aycabta
e15b0313a7 Search history to back in the middle of histories 2019-12-02 03:09:41 +09:00
aycabta
8cb3f29abf The ed_search_prev_history should always search to backward 2019-12-01 23:54:57 +09:00
aycabta
abe8fb49f0 Delete newline when C-k on emacs mode at EOL 2019-11-28 09:32:51 +09:00
aycabta
95f20f463a Consider escape sequence to calculate prompt width 2019-11-21 07:01:41 +09:00
aycabta
da0d7211aa Fix indent of a line when a newline is inserted to the next 2019-11-20 10:04:41 +09:00
aycabta
7c6bedfe5c Remove unnecessary check 2019-11-18 03:23:45 +09:00
aycabta
fa7618e4c1 Implement em_set_mark and em_exchange_mark 2019-11-15 16:50:40 +09:00
aycabta
6e72b72881 Suppress "shadowing outer local variable" warning in 2.5 2019-11-08 16:18:36 +09:00
aycabta
ea97933645 Use prompt_list to calculate height by lines 2019-11-02 00:11:15 +09:00
aycabta
d1a7305848 Insert multiline incremental search result correctly 2019-10-18 00:44:56 +09:00
aycabta
41457dcbe0 Remove unused variable 2019-10-17 16:54:06 +09:00
aycabta
60a0c20cb6 Refactor prompt generation logic 2019-10-17 16:35:18 +09:00