aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/reline] Add require 'reline/terminfo' to use Reline::Terminfo.enabled?aycabta2021-07-301-0/+1
| | | | https://github.com/ruby/reline/commit/7ef9805b35
* Rescue conversion error of inputrcaycabta2021-06-211-0/+2
|
* [ruby/reline] Fix explamation of #read_ioaycabta2021-06-211-5/+6
| | | | https://github.com/ruby/reline/commit/301ed11bec
* [ruby/reline] Fix Reline::Unicode.calculate_width when input is not a TTYJeremy Evans2021-06-211-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes an error when output is redirected: ``` $ run_ruby -rreline -e '$stderr.puts Reline::Unicode.calculate_width("\u221a").inspect' </dev/null >/dev/null /home/jeremy/tmp/ruby/lib/reline/ansi.rb:189:in `raw': Operation not supported by device (Errno::ENODEV) ``` The @@encoding -> defined?(@@encoding) changes is necessary because without that part of the commit, the following error would be raised by the above command: ``` /home/jeremy/tmp/reline/lib/reline/general_io.rb:10:in `encoding': uninitialized class variable @@encoding in Reline::GeneralIO (NameError) ``` Problem reported and initial patch for Windows provided by Richard Sharman. I tested this only on OpenBSD, but hopefully it works for other operating systems. Fixes [Bug #17493] https://github.com/ruby/reline/commit/c001971bb3
* [ruby/reline] Separate keystrokes each editing modeaycabta2021-04-081-3/+1
| | | | https://github.com/ruby/reline/commit/ee23e6f3f8
* [ruby/reline] Add Reline.ungetc to control bufferaycabta2021-03-241-0/+4
| | | | https://github.com/ruby/reline/commit/43ac03c624
* [ruby/reline] Cache pasting state in processing a keyaycabta2021-02-071-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [ruby/reline] [ruby/reline] Remove unused `attr_writer`ima1zumi2020-12-221-1/+0
| | | | | | https://github.com/ruby/reline/commit/ecdc1b7116 https://github.com/ruby/reline/commit/a7922da16b
* [ruby/reline] Fixed an exception occurred when ambiguous width character was ↵ima1zumi2020-12-221-2/+7
| | | | | | passed to `#calculate_width` [Bug #17405] https://github.com/ruby/reline/commit/f79b4c857f
* [ruby/reline] Make a log file on windows if debug env is setaycabta2020-12-171-1/+5
| | | | https://github.com/ruby/reline/commit/dff30a2d44
* [ruby/reline] Support bracketed paste modeaycabta2020-12-051-2/+12
| | | | https://github.com/ruby/reline/commit/d1a6869322
* [ruby/reline] Suppress callbacks in pastingaycabta2020-12-051-0/+6
| | | | | | | | 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
* [ruby/reline] Add require 'rbconfig' to use RbConfigaycabta2020-08-181-0/+1
| | | | https://github.com/ruby/reline/commit/4a0d32a3d0
* [ruby/reline] Support mode iconMark Delk2020-08-181-1/+2
| | | | | | Co-authored-by: aycabta <aycabta@gmail.com> https://github.com/ruby/reline/commit/067b618123
* [ruby/reline] Check Errno::EIOaycabta2020-08-181-0/+2
| | | | | | | Catch Errno::EIO what will be occurred if the console terminates I/O before Reline finishes rendering. https://github.com/ruby/reline/commit/e51eaa6d43
* Reline callbacks can take nilaycabta2020-05-141-5/+5
|
* [ruby/reline] Suppress error when check ambiguous char width in LANG=Caycabta2020-03-261-2/+8
| | | | https://github.com/ruby/reline/commit/623dffdd75
* [ruby/reline] Work with wrong $/ value correctlyaycabta2020-03-261-3/+3
| | | | https://github.com/ruby/reline/commit/962ebf5a1b
* [ruby/reline] Use IO#write instead of IO#printaycabta2020-02-141-1/+1
| | | | | | IO#print always adds a string of $\ automatically. https://github.com/ruby/reline/commit/a93119c847
* Always refer to Reline::IOGate.encodingaycabta2020-01-261-13/+15
|
* Reline: Use a more robust detection of MinTTYLars Kanis2020-01-211-2/+1
| | | | | | | | | | | | | | 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: https://github.com/git-for-windows/git/blob/c5a03b1e29c69f3f06c8fabd92493edb73469176/compat/winansi.c#L558
* Introduce an abstracted structure about the encoding of Relineaycabta2020-01-141-14/+19
| | | | | | 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.
* [ruby/reline] Implement completion_append_characterThomas Leitner2019-12-171-0/+1
| | | | | | | 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
* Support Readline.completion_quote_character by Relineaycabta2019-12-111-0/+6
|
* Support completion with case-insensitive fashionaycabta2019-12-101-5/+10
| | | | | | Reline performs completion in a case-insensitive fashon if Readline.completion_case_fold or completion-ignore-case of .inputrc are set "on".
* Support incremental search by last determined wordaycabta2019-12-031-0/+3
| | | | | | 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.
* Change argument `Proc` to `#call` defined object.manga_osyo2019-11-211-5/+5
| | | | This is the same as the behavior of Readline.
* Mintty on Cygwin isn't a kind of command prompt, can process ANSI escape codeaycabta2019-11-201-8/+8
|
* Reline#readline and Reline#readmultiline to private.osyo-manga2019-11-121-0/+2
|
* Suppress "shadowing outer local variable" warning in 2.5aycabta2019-11-081-2/+8
|
* Only taint on Ruby <2.7Jeremy Evans2019-11-051-2/+2
| | | | Ruby 2.7 deprecates taint and it no longer has an effect.
* Fix verbose warning being emittedJeremy Evans2019-10-311-1/+1
| | | | Fixes Ruby Bug 16281.
* Reline: Fix wrong variable nameLars Kanis2019-09-091-2/+2
| | | | This raised a NameError before.
* Remove duplicated delegationaycabta2019-08-271-1/+0
|
* Delegete an instance method to a class method correctlyaycabta2019-08-271-1/+1
|
* Save value to @ambiguous_width because of a accessoraycabta2019-08-271-3/+3
|
* The "private" doesn't make sence for class methods and a constantaycabta2019-08-271-2/+0
|
* Use preposing "private" to define methodsaycabta2019-08-271-6/+4
|
* Adjust method forwardings of Relineaycabta2019-08-271-13/+19
|
* Remove .freeze.manga_osyo2019-08-271-2/+2
|
* Fix `Reline::Windows`.manga_osyo2019-08-271-1/+1
|
* Refactoring Reline.manga_osyo2019-08-271-324/+317
|
* Remove test_mode in `lib/reline`.manga_osyo2019-08-271-7/+0
|
* Use host_os from RbConfig to detect host OS.Charles Oliver Nutter2019-08-061-1/+1
| | | | | | | | 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
* Add `class Reline::History` and test.manga_osyo2019-07-151-60/+2
|
* Add arg check to Reline.dig_perfect_match_proc=aycabta2019-07-111-0/+1
|
* Print starting debug message with RELINE_STDERR_TTYaycabta2019-06-181-0/+1
|
* Implement auto indent for multilineaycabta2019-06-181-0/+10
|
* Remove debug printaycabta2019-06-141-4/+0
|
* Add Reline.prompt_procaycabta2019-06-141-0/+14
|