aycabta
7624f52757
[ruby/reline] Forced newline insertion is not just cursor moving
...
https://github.com/ruby/reline/commit/0e30a49d03
2020-12-05 02:58:59 +09:00
aycabta
37a574b527
[ruby/reline] Drop prompt list cache when num of lines is changed
...
https://github.com/ruby/reline/commit/1959e22043
2020-12-05 02:58:59 +09:00
aycabta
2910684c45
[ruby/reline] Cache dynamic prompt for 0.5sec
...
https://github.com/ruby/reline/commit/06b89d0e61
2020-12-05 02:58:59 +09:00
aycabta
b763c5cdf0
[ruby/reline] Stop rerendering if the cursor is only moved
...
https://github.com/ruby/reline/commit/30e8eaf855
2020-12-05 02:58:59 +09:00
aycabta
a297565a4e
[ruby/reline] Split #rerender method that is too huge
...
https://github.com/ruby/reline/commit/d0fbc89253
2020-12-05 02:58:59 +09:00
aycabta
b545ab219b
[ruby/reline] Stop rerendering whole screen when adding newline at end of buffer
...
The rendering time in IRB has been reduced as follows:
start = Time.now
def each_top_level_statement
initialize_input
catch(:TERM_INPUT) do
loop do
begin
prompt
unless l = lex
throw :TERM_INPUT if @line == ''
else
@line_no += l.count("\n")
next if l == "\n"
@line.concat l
if @code_block_open or @ltype or @continue or @indent > 0
next
end
end
if @line != "\n"
@line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
break if @io.eof?
@line = ''
@exp_line_no = @line_no
@indent = 0
rescue TerminateLineInput
initialize_input
prompt
end
end
end
end
puts "Duration: #{Time.now - start} seconds"
0.33sec -> 0.22sec
https://github.com/ruby/reline/commit/496c6a1892
2020-12-05 02:58:59 +09:00
aycabta
c85035363f
[ruby/reline] Key strokes like 2dl should behave d2l
...
Key strokes, vi arg, operator, and motion should be treated as operator, vi
arg, and motion.
https://github.com/ruby/reline/commit/d1a7e74aa4
2020-12-05 02:58:58 +09:00
aycabta
dbfc1f30d5
[ruby/reline] Add alias vi-movement-mode to vi-command-mode for compatibility
...
https://github.com/ruby/reline/commit/a79c297567
2020-12-05 02:58:58 +09:00
aycabta
48742614df
[ruby/reline] Move alias_method to right after original definition
...
https://github.com/ruby/reline/commit/b7c8b93fa9
2020-12-05 02:58:58 +09:00
aycabta
9750c27afc
[ruby/reline] Call process_insert when the end of pasting plural fullwidth chars
...
https://github.com/ruby/reline/commit/594484d9f9
2020-12-05 02:58:58 +09:00
aycabta
ba8e5f77eb
[ruby/reline] Motions e, E, t, f should include a char on cursor if follows operator
...
https://github.com/ruby/reline/commit/86e9a76499
2020-12-05 02:58:58 +09:00
aycabta
6be3b2da19
[ruby/reline] Implement vi_yank
...
https://github.com/ruby/reline/commit/164aaf9a5f
2020-12-05 02:58:58 +09:00
aycabta
2dc4aca8d1
[ruby/reline] Operator with arg need to make sure that they take arg to avoid crashing
...
https://github.com/ruby/reline/commit/1c0c06de1f
2020-12-05 02:58:58 +09:00
aycabta
92b22db6a7
[ruby/reline] Unimplemented vi command should be no-op
...
https://github.com/ruby/reline/commit/abc90e6867
2020-12-05 02:58:58 +09:00
aycabta
faf8f216be
[ruby/reline] Keep operator proc as a local variable in the scope
...
The proc variable will be used later so the instance variable will be changes.
https://github.com/ruby/reline/commit/496c4361f6
2020-12-05 02:58:58 +09:00
aycabta
564aadce62
[ruby/reline] Skip em_exchange_mark without mark
...
https://github.com/ruby/reline/commit/abb56e5ec3
2020-12-05 02:58:58 +09:00
aycabta
266ffdde8e
[ruby/reline] Continuous insertion buffering
...
The rendering time in IRB has been reduced as follows:
start = Time.now
[{"_id"=>"5f9072a4589a06d2d74b6028",
"index"=>0,
"guid"=>"6b3051e2-dbc7-4537-bdb9-6cd7bb5358a7",
"isActive"=>true,
"balance"=>"$1,442.84",
"picture"=>"http://placehold.it/32x32 ",
"age"=>34,
"eyeColor"=>"blue",
"name"=>{"first"=>"Ward", "last"=>"Levy"},
"company"=>"HYPLEX",
"email"=>"ward.levy@hyplex.us",
"phone"=>"+1 (867) 568-3319",
"address"=>"867 Cobek Court, Clara, Maryland, 3254",
"about"=>
"Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing.",
"registered"=>"Monday, May 25, 2015 6:51 AM",
"latitude"=>"16.001127",
"longitude"=>"-72.377848",
"tags"=>["dolore", "nostrud", "occaecat", "cillum", "nisi"],
"range"=>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
"friends"=>
[{"id"=>0, "name"=>"Alison Bryant"},
{"id"=>1, "name"=>"Ester Espinoza"},
{"id"=>2, "name"=>"Sullivan Kane"}],
"greeting"=>"Hello, Ward! You have 7 unread messages.",
"favoriteFruit"=>"apple"}]
puts "Duration: #{Time.now - start} seconds"
2.17sec -> 0.92sec
start = Time.now
"Exercitation eu ex aliqua sit. Pariatur aliquip incididunt sint id non consectetur ullamco Lorem ea mollit duis amet sint labore. Commodo laborum labore commodo officia in cillum adipisicing esse excepteur cupidatat adipisicing ut. Non esse incididunt voluptate aliquip cillum eu aute duis laboris sit et. Amet enim quis tempor occaecat excepteur exercitation excepteur deserunt amet cillum adipisicing."
puts "Duration: #{Time.now - start} seconds"
1.57sec -> 0.22sec
start = Time.now
def each_top_level_statement
initialize_input
catch(:TERM_INPUT) do
loop do
begin
prompt
unless l = lex
throw :TERM_INPUT if @line == ''
else
@line_no += l.count("\n")
next if l == "\n"
@line.concat l
if @code_block_open or @ltype or @continue or @indent > 0
next
end
end
if @line != "\n"
@line.force_encoding(@io.encoding)
yield @line, @exp_line_no
end
break if @io.eof?
@line = ''
@exp_line_no = @line_no
@indent = 0
rescue TerminateLineInput
initialize_input
prompt
end
end
end
end
puts "Duration: #{Time.now - start} seconds"
0.88sec -> 0.77sec
https://github.com/ruby/reline/commit/7d87ac5a12
2020-12-05 02:58:58 +09:00
aycabta
55cc397a87
[ruby/reline] Suppress callbacks in pasting
...
IRB uses Reline's 3 dynamic real-time callbacks with calling Ripper;
output_modifier_proc, prompt_proc, and auto_indent_proc. These processing
times make the paste time too long.
https://github.com/ruby/reline/commit/beec3399a8
2020-12-05 02:58:58 +09:00
aycabta
4af2e4111b
[ruby/reline] Deduplicate completed items
...
https://github.com/ruby/reline/commit/2dabf0c786
2020-12-05 02:58:58 +09:00
aycabta
f36dc2b6de
[ruby/reline] Treat prompt correctly when Reline.prompt_proc isn't set
...
https://github.com/ruby/reline/commit/9c9ba0eff3
2020-09-12 08:35:52 +09:00
aycabta
ce389ade45
[ruby/reline] Move cursor to currect vertical pos after rendering a logical line
...
https://github.com/ruby/reline/commit/9b932df544
2020-09-12 08:35:52 +09:00
aycabta
9baf1bd0a4
[ruby/reline] Stop using chomp option of lines method
...
https://github.com/ruby/reline/commit/3e2f55c3e0
2020-09-12 08:35:52 +09:00
aycabta
0ec19cc843
[ruby/reline] Stop erasing chars after the cursor at eol
...
When the cursor is at the end of the line and erases characters after the
cursor, some terminals delete the character at the cursor position.
https://github.com/ruby/reline/commit/e96ec97b02
2020-09-12 08:35:52 +09:00
Hiroshi SHIBATA
b194973dcd
Revert the related commits about `Tempfile.open` change.
...
Start with fa21985a7a
to d7492a0be8
2020-09-09 21:10:48 +09:00
Benoit Daloze
3beecafc2c
Fix usages of Tempfile.open(&block) that expected the file to still be there after the block
2020-08-29 12:30:24 +02:00
aycabta
1f09c43628
[ruby/reline] Move width calculator methods to Reline::Unicode
...
https://github.com/ruby/reline/commit/f348ecd9f5
2020-08-28 11:05:18 +09:00
Nobuyoshi Nakada
f2435c1508
[ruby/reline] Get rid of loading pathname unnecessarily
...
https://github.com/ruby/reline/commit/9bd54b7f1c
2020-08-18 19:09:58 +09:00
aycabta
ad24eaabfd
[ruby/reline] Remove duplicated line of code
...
Co-authored-by: Quentin Sabah <quentin.sabah@gmail.com>
https://github.com/ruby/reline/commit/5526e9f7ee
2020-08-18 19:08:50 +09:00
Mark Delk
44b24ab4c1
[ruby/reline] Support mode icon
...
Co-authored-by: aycabta <aycabta@gmail.com>
https://github.com/ruby/reline/commit/067b618123
2020-08-18 19:08:32 +09:00
aycabta
f56e05fa7d
[ruby/reline] Remove unnecessary TODO commnet
...
https://github.com/ruby/reline/commit/23c67fb7b3
2020-05-17 19:26:53 +09:00
aycabta
db0d850d4e
[ruby/reline] Add ed_search_next_history
...
https://github.com/ruby/reline/commit/ca750b676b
2020-04-18 23:12:52 +09:00
aycabta
bea3e31e5f
[ruby/reline] Add ed_search_prev_history
...
https://github.com/ruby/reline/commit/e9ae288825
2020-04-18 23:12:52 +09:00
aycabta
08c1c3f220
[ruby/reline] Use vi_search_{prev,next} to incremental search
...
https://github.com/ruby/reline/commit/cab312f584
2020-04-18 23:09:31 +09:00
aycabta
afe997857e
[ruby/reline] Rename search_history with incremental_search_history
...
https://github.com/ruby/reline/commit/d563063ea0
2020-04-18 23:09:31 +09:00
aycabta
f245fb1ab8
[ruby/reline] Work with wrong $/ value correctly
...
https://github.com/ruby/reline/commit/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.
https://github.com/ruby/reline/commit/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.
https://github.com/ruby/reline/commit/4bfea07e4a
2020-02-02 03:28:20 +09:00
aycabta
2943ebd240
[ruby/reline] Implement vi_change_meta
...
https://github.com/ruby/reline/commit/8538e0e10f
2020-01-21 09:52:32 +09:00
aycabta
3b407abe9b
[ruby/reline] Implement vi_prev_char and vi_to_prev_char
...
https://github.com/ruby/reline/commit/0ad3ee63fa
2020-01-20 19:13:19 +09:00
aycabta
b17797a694
[ruby/reline] Implement vi_to_next_char
...
https://github.com/ruby/reline/commit/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
```
https://github.com/ruby/reline/commit/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.
https://github.com/ruby/reline/commit/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
aycabta
db84123600
Calculate prompt width correctly
2019-10-17 02:19:01 +09:00
aycabta
e26c6d4ab8
Collect multiline prompt logic into a method
2019-10-17 01:56:20 +09:00
aycabta
7df227804a
Support multiline history in incremental search
2019-10-16 22:35:58 +09:00
aycabta
259601ab57
Support backspace in incremental search
2019-10-16 02:55:45 +09:00
aycabta
a9e9cd2036
Flush console just after printing
2019-10-07 14:15:05 +09:00
Adam Cammack
f9332ad833
Fix previous history in vi_insert mode
2019-09-17 15:14:38 +09:00
Adam Cammack
a3533bc904
Fix history navigation in vi_insert mode
2019-09-17 15:14:38 +09:00
aycabta
98f919ed47
The stdlib readline should raise Interrupt when pressing C-c
2019-09-14 00:16:31 +09:00
aycabta
e9bc8b35c6
Behave ESC key correctly when vi command mode
2019-09-08 03:26:35 +09:00
aycabta
c5bb074fe7
Re-calculate state variables of screen when screen size changes
2019-09-01 11:02:58 +09:00
aycabta
0f405541bf
Support SIGWINCH
2019-08-29 14:37:19 +09:00
aycabta
800821831d
Always check multiline termination
2019-08-22 06:02:27 +09:00
Alan Wu
e9f82585ee
Don't crash when deleting at the end of the line
...
To reproduce this bug, type one character into irb, then press the
delete key on your keyboard.
2019-08-18 07:43:19 +09:00
Kazuhiro NISHIYAMA
a4a2dd7942
Revert a6e32855d0
partially
...
Fix TypeError when typing `''.[TAB]`
2019-08-09 16:29:43 +09:00
aycabta
d626ca1e98
Remove obsolete TODO comment
2019-08-06 20:03:23 +09:00
Nobuyoshi Nakada
a6e32855d0
[reline] Do not escape and compile regexp for each byte
2019-07-28 09:47:40 +09:00
aycabta
0f9ec4a877
Check wether multibyte character is split
2019-07-25 17:19:16 +09:00
aycabta
c8ee44f44c
Fix showing doc of "nil.to_s", nil doesn't have #name
2019-07-19 08:23:41 +09:00
Luke Gruber
3163a07878
fix issue with 'SIGINT' handling in LineEditor#reset
...
@old_trap is the string "DEFAULT" and not a callable object (Proc)
if there are no other signal handlers for SIGINT signal to chain.
2019-07-14 15:51:09 +09:00
Nobuyoshi Nakada
688cef2169
Refactored width calculations
2019-07-06 12:31:11 +09:00
Nobuyoshi Nakada
44aae5fee6
Simplified
2019-07-06 12:11:12 +09:00
Nobuyoshi Nakada
12e06d32f5
Use lstrip instead of gsub which can match only once
2019-07-04 18:49:42 +09:00
Nobuyoshi Nakada
90c51ca391
New indent must be non-negative number
2019-07-01 20:46:00 +09:00
aycabta
72bfc52de6
Decrease indent by closing token correctly
2019-06-27 01:21:06 +09:00
aycabta
c4c47b792d
Disable auto indent when move cursor up or down
...
This commit suppresses a strange behavior below:
if true
1[cursor]
end
and press down key
if true
1
end
2019-06-20 16:00:30 +09:00
aycabta
235e72f17e
Implement auto indent for multiline
2019-06-18 20:58:18 +09:00
aycabta
2fb1564c02
Implement line_no correctly
2019-06-16 14:46:28 +09:00
aycabta
d0e5564140
Set allow_escape_code for prompt
2019-06-14 08:45:35 +09:00
aycabta
64310b2573
Add Reline.prompt_proc
2019-06-14 07:42:53 +09:00
aycabta
02880d1f4a
Skip transpose-words if less than 2 word
2019-06-06 04:57:52 +09:00
aycabta
9a07915ae2
Add aliases for commands for changing text macro
2019-06-04 08:35:01 +09:00
aycabta
4b7213a85a
Implement transpose-words
2019-06-04 07:23:36 +09:00
aycabta
d7c3eb570b
Erase VI_OPERATORS
...
The operators are using @waiting_operator_proc in vi mode.
2019-06-03 17:24:49 +09:00
aycabta
5524de5ca0
Add aliases for commands for moving macro
2019-06-03 03:41:40 +09:00
aycabta
3428922437
The ed_move_to_beg is different from vi_first_print
2019-06-03 03:29:34 +09:00
Nobuyoshi Nakada
65fdb90325
Reline::LineEditor::ARGUMENTABLE is no longer used
2019-06-03 02:03:15 +09:00
Nobuyoshi Nakada
3457ce4486
Fix ArgumentError in aliased macro
...
Closes: https://github.com/ruby/ruby/pull/2221
2019-06-03 01:35:48 +09:00
aycabta
7b1c1b9492
Suppress error of macro not found
2019-06-02 05:07:13 +09:00
aycabta
34727475d0
Remove an unnecessary argument
2019-06-01 15:07:52 +09:00
Takashi Kokubun
cb40a21da0
Warn compile_error only when input is finished
...
Let's say we are in progress to write `"foo"`:
```
irb> "fo
```
at this moment, nothing is wrong.
It would be just a normal way to write `"foo"`.
Prior to this commit, the `fo` part was warned because of
5b64d7ac6e
. But I think warning such a
normal input is not valuable for users.
However, we'd like to warn `:@1` or `@@1` which is also a syntax error.
Then this commit switches the syntax highlight based on whether the
input text is finished or not. When it's not finished yet, it does not
warn compile_error.
2019-05-31 06:54:00 +09:00
aycabta
8f83fe3b02
Finish with ^D only when input is completely empty in vi insert mode
2019-05-31 05:53:02 +09:00
aycabta
279c8e14d4
Use rebuilt buffer data to rerender all
2019-05-30 20:54:28 +09:00
aycabta
74a0e3ec23
Use start_with? for escaped quote too
2019-05-30 20:06:59 +09:00
aycabta
ecd0f1d966
Use negative lookahead and start_with?
2019-05-30 18:29:26 +09:00
aycabta
fcca39fa73
Fix strange vertical cursor moving when adding a newline at bottom
2019-05-30 18:21:09 +09:00
aycabta
5a229b0a88
Calculate vertical position correctly when rerendering all lines
2019-05-30 15:19:30 +09:00
aycabta
90014dddec
Fix broken rendering when the last line is auto-wrapped
2019-05-30 15:04:37 +09:00
aycabta
eae953ba9f
Rerender following lines when line number increased
2019-05-30 14:19:58 +09:00
aycabta
1cf9f79342
Clear remaining lines when line number decreased
2019-05-30 14:04:28 +09:00
aycabta
cb520e7623
Fix the auto-wrap behabior that was too buggy
2019-05-30 12:29:38 +09:00
aycabta
57b4df07bc
Use Reline.completer_quote_characters to complete
2019-05-28 08:38:55 +09:00
aycabta
7447c7b651
Join next line if deletes newline at end of line
2019-05-28 01:52:04 +09:00
aycabta
69c7ad1723
Exit only when blank input
2019-05-28 01:51:01 +09:00
aycabta
9a68aba79f
Support OSC and treat \1 \2 correctly
2019-05-28 00:48:02 +09:00
aycabta
70166b3ca3
Revert "Support OSC and treat \1 \2 correctly"
...
This reverts commit 77bfebebc4
.
2019-05-28 00:21:24 +09:00
aycabta
77bfebebc4
Support OSC and treat \1 \2 correctly
2019-05-28 00:17:52 +09:00
Nobuyoshi Nakada
4c277364a5
CSI allows empty digit which equals 0
2019-05-27 11:47:09 +09:00
aycabta
1d301acbe8
Fix rendering bug of ^D
2019-05-27 10:09:21 +09:00
aycabta
9c136f3dea
Move to next of last line by ^D
2019-05-27 08:39:39 +09:00
aycabta
4e2c7783e3
Check blank history
2019-05-27 08:13:48 +09:00
aycabta
2805c55aa3
Move to next of last line by ^C
2019-05-27 07:35:35 +09:00
aycabta
c49796c930
Reline should move to next line after finished in Readline mode
2019-05-27 07:00:06 +09:00
aycabta
2c91c5b329
Move to the other line when press <- at head or -> at tail
2019-05-27 06:04:42 +09:00
aycabta
716ba4a127
Implement J to join lines in vi command mode
2019-05-27 05:45:08 +09:00
aycabta
64dc21830a
Remove \1 and \2 that escape CSI before render
2019-05-27 05:01:18 +09:00
aycabta
ec75901120
Fix completion menu state calculation
2019-05-26 01:32:29 +09:00
aycabta
d9c41f2dec
Use Reline.completer_word_break_characters to complete
2019-05-26 00:00:19 +09:00
Takashi Kokubun
061c781a09
Drop method obsoleted by b83119be9e
...
We might need to do the same thing in IRB::Color now, but I'm not doing
that as I assume ANSI escape sequence does not come from a user input
though Reline.
2019-05-25 00:38:19 -07:00
Takashi Kokubun
b83119be9e
Incremental syntax highlight for IRB source lines
...
Closes: https://github.com/ruby/ruby/pull/2202
2019-05-24 23:54:52 -07:00
aycabta
ff43b22627
Enter key always means evaluate in Reline#readmultiline
2019-05-25 02:13:14 +09:00
aycabta
637ee7ee38
Fix C-v C-j
2019-05-25 01:13:02 +09:00
aycabta
eb4e774711
Support Meta key in Reline
2019-05-24 23:38:40 +09:00
aycabta
bb29ed6e33
C-v C-j means an newline insertion
2019-05-23 08:33:20 +09:00
aycabta
da3fabc976
Change behavior to confirm multiline termination
...
Always checks termination if you press Enter at last line.
2019-05-23 08:25:06 +09:00
aycabta
c48d9139d4
Remove unnecessary variable in LineEditor
2019-05-22 07:03:29 +09:00
aycabta
c00d805672
Support CSI sequences in prompt
2019-05-22 06:48:27 +09:00
aycabta
f8732bd4d6
Reline#reset should initalize @rest_height and @screen_size eveytime
2019-05-22 02:52:29 +09:00
aycabta
bb5b4f9044
Cursor should be at line head after line breaking
2019-05-21 18:45:00 +09:00
aycabta
6d93baaedd
Support DEL key
2019-05-21 17:46:41 +09:00
aycabta
df6a673ca5
Fix vertical cursor moving when splitting line
2019-05-21 08:10:36 +09:00
aycabta
34d7ec4e9b
Finish only when buffer contains non-blank line
2019-05-21 01:50:07 +09:00
aycabta
b69dfdb4b3
Cursor up should reduce 1 than editing height
2019-05-21 01:49:27 +09:00
aycabta
6592f5fcc8
Check bytesize in vi command mode last char back
2019-05-21 01:10:09 +09:00
aycabta
9f49ff4965
Cursor can't move to eol when vi command mode
2019-05-20 07:50:14 +09:00
aycabta
075e1acb4c
Readline.completion_proc accepts US-ASCII
2019-05-20 04:47:58 +09:00
aycabta
f54aa6c5b2
Rename confuzed name Reline::IO with Reline::IOGate
2019-05-15 15:52:18 +09:00
aycabta
1e65196b54
Check encoding when Readline completion
2019-05-14 14:53:34 +09:00
aycabta
602ef62ae6
Rescue CompatibilityError for Readline's completion
2019-05-14 14:11:28 +09:00
aycabta
741321704f
Remove unused variable in LineEditor
2019-05-14 07:12:59 +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
c137f015ab
Add Reline.pre_input_hook interface
2019-05-13 02:20:20 +09:00
aycabta
9cb821b024
Implement Reline.input= and Reline.output=
2019-05-13 02:14:48 +09:00
aycabta
bb56b89900
Add ed_search_prev_history to Reline
2019-05-13 01:51:05 +09:00
aycabta
0f45bd0584
Split namespace of env-dependent I/O classes
2019-05-13 00:22:27 +09:00
aycabta
aaaede8bcf
Change LineEditor instance in Reline to class var
2019-05-12 21:22:04 +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