aycabta
6fda457448
[ruby/reline] Suppress warning; unused variable
...
https://github.com/ruby/reline/commit/74a6124e8d
2021-08-29 20:30:32 +09:00
aycabta
1e527c8a55
[ruby/reline] Remove an unnecessary variable
...
https://github.com/ruby/reline/commit/5435c1aa3f
2021-08-29 20:30:32 +09:00
aycabta
fb0fc20196
[ruby/reline] Implement dialog with autocomplete callback
...
https://github.com/ruby/reline/commit/1401d6165e
2021-08-29 20:30:32 +09:00
aycabta
e66200780b
[ruby/reline] Separate calling completion proc with checking args
...
https://github.com/ruby/reline/commit/3203cb97db
2021-08-29 20:30:32 +09:00
aycabta
de93b8b069
Handle SIGINT in other thread correctly
...
Co-authored-by: Koichi Sasada <ko1@atdot.net>
2021-08-04 18:29:42 +09:00
aycabta
5bb7b57129
Use Symbol of signal for trap
2021-08-04 18:29:42 +09:00
aycabta
95a3cdade6
[ruby/reline] Remove FIXME comment in #render
...
https://github.com/ruby/reline/commit/acd8f8efbb
2021-06-21 17:58:49 +09:00
aycabta
b06218ce6f
[ruby/reline] Remove TODO comment in #render_partial
...
https://github.com/ruby/reline/commit/bb6ea232c2
2021-06-21 17:58:49 +09:00
aycabta
7e93917458
[ruby/reline] Reset @rest_height when clear screen
...
https://github.com/ruby/reline/commit/3a7019b0d5
2021-04-02 17:33:48 +09:00
aycabta
89caf51d93
[ruby/reline] Suppress crashing when completer_{quote,word_break}_characters is empty
...
https://github.com/ruby/reline/commit/c6f1164942
2021-03-24 15:43:34 +09:00
aycabta
758f2b35f9
[ruby/reline] Support preposing and postposing for Reline.completion_proc
...
https://github.com/ruby/reline/commit/1f469de90c
2021-03-24 15:43:27 +09:00
aycabta
4b33d860e8
[ruby/reline] Reline.delete_text removes the current line in multiline
...
https://github.com/ruby/reline/commit/da90c094a1
2021-03-24 15:43:19 +09:00
aycabta
aeac4ddcc0
[ruby/reline] Use UTF-8 only for width calc, rest uses original encoding
...
I confirmed that libvterm supports only which are UTF-8, US ASCII, UK, and
DEC graphics by reading source code, so can't test this patch by
yamatanoorogi gem through vterm gem for now.
This fixes ruby/irb#190 .
https://github.com/ruby/reline/commit/44596c0cc7
2021-02-21 06:44:05 +09:00
Yoshinao Muramatu
38d30a6942
[ruby/reline] check ENABLE_VIRTUAL_TERMINAL_PROCESSING flag and switch eof processing
...
https://github.com/ruby/reline/commit/3535676689
2021-02-21 06:43:52 +09:00
Yoshinao Muramatu
38cefac7ce
[ruby/reline] We still need support new and legacy behavior.
...
Revert "Support for change in Windows-specific behavior at eol"
This reverts commit cad4de6ee841b43f3f0e441626f9415c3eda0f82.
https://github.com/ruby/reline/commit/646587fc2c
2021-02-21 06:43:41 +09:00
Eamonn Webster
ac9e3b514b
[ruby/reline] Avoid tripping over nil prompt
...
https://github.com/ruby/reline/commit/d4d9d3e3d4
2021-02-21 06:41:11 +09:00
aycabta
300084a854
[ruby/reline] Terminate correctly in the middle of lines higher than the screen
...
https://github.com/ruby/reline/commit/e1d9240ada
2021-02-07 05:12:19 +09:00
aycabta
fee19da230
[ruby/reline] Autowrap correctly when inserting chars in the middle of a line
...
https://github.com/ruby/reline/commit/ebaf37255f
2021-02-07 05:12:07 +09:00
aycabta
a19ed1623f
[ruby/reline] The vi_histedit supports multiline
...
This closes ruby/reline#253 .
https://github.com/ruby/reline/commit/f131f86d71
2021-02-07 05:11:54 +09:00
aycabta
a608bb3e9b
[ruby/reline] Move cursor just after the last line when finished
...
https://github.com/ruby/reline/commit/ba06e4c480
2021-02-07 05:11:47 +09:00
aycabta
08162f0e69
[ruby/reline] Update cursor info by inserting newline even if not in pasting
...
https://github.com/ruby/reline/commit/92d314f514
2021-02-07 05:11:41 +09:00
aycabta
b371ca3f4f
[ruby/reline] Handle past logs correctly when the code is higher than the screen
...
https://github.com/ruby/reline/commit/f197139b4a
2021-02-07 05:11:27 +09:00
aycabta
bd0f8b36fd
[ruby/reline] Show all lines higher than the screen when finished
...
On Unix-like OSes, logs prior to the screen are not editable. When the code
is higher than the screen, the code is only shown on the screen until input
is finished, but when it is finished, all lines are outputted.
https://github.com/ruby/reline/commit/8cd9132a39
2021-02-07 05:11:13 +09:00
aycabta
03523fdafb
[ruby/reline] Scroll down when ^C is pressed
...
https://github.com/ruby/reline/commit/6877a7e3f5
2021-02-07 05:11:00 +09:00
aycabta
ec6929a5dd
[ruby/reline] Remove an unused variable
...
https://github.com/ruby/reline/commit/123ea51166
2021-02-07 05:10:50 +09:00
aycabta
433b975fe8
[ruby/reline] Initialize uninitialized variables in tests
...
https://github.com/ruby/reline/commit/25af4bb64b
2021-02-07 05:10:36 +09:00
aycabta
b69c965f47
[ruby/reline] Cache pasting state in processing a key
...
Because it's too slow.
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.22sec -> 0.14sec
https://github.com/ruby/reline/commit/b8b3dd52c0
2021-02-07 05:09:18 +09:00
aycabta
05df7e0d4a
[ruby/reline] Support for change in Windows-specific behavior at eol
...
The behavior of automatically moving the cursor to the next line when
displaying a char at the eol on Windows suddenly disappeared.
https://github.com/ruby/reline/commit/cad4de6ee8
2021-01-18 02:09:43 +09:00
aycabta
1aba1a5103
[ruby/reline] Initialize a variable just in case
...
https://github.com/ruby/reline/commit/29b10f6e98
2021-01-18 02:07:37 +09:00
aycabta
eb5a094fc0
[ruby/reline] Move the cursor correctly when deleting at eol
...
This fixes ruby/reline#246 .
https://github.com/ruby/reline/commit/07a73ba601
2021-01-13 01:12:54 +09:00
aycabta
44817db28b
[ruby/reline] Handle ed_search_{prev,next}_history in multiline correctly
...
The current line was being handled incorrectly when displaying the hit
history, so it has been fixed to be correct.
https://github.com/ruby/reline/commit/a3df4343b3
2021-01-13 01:12:54 +09:00
aycabta
01235f800f
[ruby/reline] Suppress auto indent for adding newlines in pasting
...
Co-authored-by: Juanito Fatas <me@juanitofatas.com>
https://github.com/ruby/reline/commit/074bb017a7
2021-01-08 13:25:18 +09:00
aycabta
76c9a3c8c6
[ruby/reline] Suppress crashing when dynamic_prompt_proc returns a broken prompt list
...
Co-authored-by: Juanito Fatas <me@juanitofatas.com>
https://github.com/ruby/reline/commit/558f7be168
2021-01-08 13:25:18 +09:00
aycabta
88af5085db
[ruby/reline] Suppress crashing when auto_indent_proc returns broken indent info
...
Co-authored-by: Juanito Fatas <me@juanitofatas.com>
https://github.com/ruby/reline/commit/7c24276275
2021-01-08 13:25:18 +09:00
aycabta
ea75aed98e
[ruby/reline] Correct var names in Reline were different from vi-*-mode-string
...
https://github.com/ruby/reline/commit/8255fc93b9
2021-01-08 13:25:18 +09:00
aycabta
54c1dcba2b
[ruby/reline] Update cursor correctly when just cursor moving
...
This fixes ruby/reline#236 and ruby/reline#239 .
https://github.com/ruby/reline/commit/3e3c89d00b
2021-01-08 13:25:18 +09:00
aycabta
9a7647d9eb
[ruby/reline] Doesn't contain terminate spaces by cw
...
This closes ruby/reline#233 .
https://github.com/ruby/reline/commit/4c3f2e2eae
2020-12-24 23:26:22 +09:00
aycabta
78421319d0
[ruby/reline] Use #bytesize for vi_replace_char
...
This closes ruby/reline#228 .
https://github.com/ruby/reline/commit/8205fa0b00
2020-12-24 23:26:22 +09:00
aycabta
8d5d139afa
[ruby/reline] Suppress crashing when boken prompt_list is given
...
https://github.com/ruby/reline/commit/922d087e7a
2020-12-24 23:26:22 +09:00
aycabta
634b231f33
[ruby/reline] Discard prompt cache by changing mode icon
...
https://github.com/ruby/reline/commit/bfeda8a79b
2020-12-24 23:26:22 +09:00
aycabta
b52bc4a9c2
[ruby/reline] Support isearch-terminators
...
https://github.com/ruby/reline/commit/a7922da16b
2020-12-22 23:45:43 +09:00
aycabta
294552ca6c
[ruby/reline] Render refreshed prompt just after i-search finished
...
https://github.com/ruby/reline/commit/0d3188fe34
2020-12-22 23:45:43 +09:00
aycabta
c2a5594e27
[ruby/reline] Use cached prompt list when just moved the cursor
...
https://github.com/ruby/reline/commit/cfe619460b
2020-12-19 02:12:11 +09:00
aycabta
d4257c6152
[ruby/reline] Yank by em-kill-region correctly
...
This closes ruby/reline#106 .
https://github.com/ruby/reline/commit/2549a52e15
2020-12-19 02:12:11 +09:00
aycabta
af2c81e10c
[ruby/reline] Bind yank-pop correctly
...
https://github.com/ruby/reline/commit/3c74beac65
2020-12-19 02:12:11 +09:00
aycabta
2b8fa78176
[ruby/reline] Support longer than screen height
...
https://github.com/ruby/reline/commit/e83a3de9ed
2020-12-17 20:14:59 +09:00
Yale Kozinski
d597d7a8b6
Fixing glitchy kill ring behavior in irb
...
See https://github.com/ruby/irb/issues/85 for details
2020-12-17 20:04:42 +09:00
ima1zumi
68d3952c52
[ruby/reline] Fix breaking to input Emoji with ZWJ.
...
https://github.com/ruby/reline/commit/f21dfdbb11
2020-12-11 23:08:06 +09:00
aycabta
3bf7b999e5
[ruby/reline] Editing to initial content is not just cursor moving
...
https://github.com/ruby/reline/commit/0a4f175b0a
2020-12-08 00:08:41 +09:00
aycabta
0cf073088e
[ruby/reline] Process insertion buffer forcibly
...
https://github.com/ruby/reline/commit/89d49ec9e0
2020-12-05 02:58:59 +09:00
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