aboutsummaryrefslogtreecommitdiffstats
path: root/lib/reline.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/reline] Introduce a new class Reline::Face to configureHASUMI Hitoshi2023-11-061-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | character attributes (https://github.com/ruby/reline/pull/552) * Reine::Face * fix test_yamatanooroti * Define singleton methods to make accessors to attributes of a face * s/display/foreground/ * s/default/default_style/ && s/normal_line/default/ && s/enhanced_line/enhanced/ * fix typo * FaceConfig.new now takes keyword arguments * Update lib/reline/face.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Update test/reline/test_face.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Fix to correspond to frozen_string_literal * Face::FaceConfig -> Face::Config * ref https://github.com/ruby/reline/pull/552#pullrequestreview-1677282576 * delete unused ivar * ref https://github.com/ruby/reline/pull/552#discussion_r1358783723 * insert "\e[0m" into all SGR * tiny fix * ESSENTIAL_DEFINE_NAMES ref https://github.com/ruby/reline/pull/552#discussion_r1367722247 * Change to Hash-accessor style - Reline::Face[:completion_dialog].enhanced -> Reline::Face[:completion_dialog][:enhanced] - Reline::Face.configs shows all defined values * Cache array method call in local variable * Tests for Face configuration variations * resolve https://github.com/ruby/reline/pull/552#pullrequestreview-1710938154 * amend to * check invalid SGR parameter in :style * The order of define values should be preserved * Update test/reline/test_face.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Update test/reline/test_face.rb Co-authored-by: Stan Lo <stan001212@gmail.com> * Add methods: load_initial_config and reset_to_initial_config. And teardown in tests * omission in amending "style: :default" to "style: :reset" * refs https://github.com/ruby/reline/issues/598 * Fix link * amend method name * Update lib/reline/face.rb Co-authored-by: ima1zumi <52617472+ima1zumi@users.noreply.github.com> --------- https://github.com/ruby/reline/commit/fdc1d3b1e5 Co-authored-by: Stan Lo <stan001212@gmail.com> Co-authored-by: ima1zumi <52617472+ima1zumi@users.noreply.github.com>
* [ruby/reline] Use fdiv for keyseq_timeout msec to sec conversiontomoya ishida2023-08-201-3/+2
| | | | | | (https://github.com/ruby/reline/pull/583) https://github.com/ruby/reline/commit/a6504acd63
* [ruby/reline] Remove Timeout usageStan Lo2023-08-201-26/+15
| | | | | | | | | | | | | | | (https://github.com/ruby/reline/pull/580) Timeout's implementation relies on Thread, which would conflict with `ruby/debug`'s thread-freezing implementation and has casued issues like - ruby/debug#877 - ruby/debug#934 - ruby/debug#1000 This commit avoids the issue by completely removing the use of Timeout. https://github.com/ruby/reline/commit/d4f0cd3fe1
* [ruby/reline] Reduce direct references to `Reline::IOGate`Stan Lo2023-07-071-28/+32
| | | | | | | | | | | | | | | | | (https://github.com/ruby/reline/pull/566) * Avoid referencing IOGate from IOGate classes The only time those classes being used is when themselves being the IOGate. So when referencing to IOGate, it's better to use `self` instead. * Avoid referencing to IOGate from LineEditor directly * Avoid referencing to IOGate from Core directly * Reference to Reline.core directly * Replace Reline::IOGate with Reline.core.io_gate
* [ruby/reline] Update Relin::IOGate dinamically when it is neededtomoya ishida2023-07-051-0/+14
| | | | | | (https://github.com/ruby/reline/pull/560) https://github.com/ruby/reline/commit/4680d1c9e0
* [ruby/reline] Refactor Reline::CoreStan Lo2023-07-041-18/+14
| | | | | | | | (https://github.com/ruby/reline/pull/561) * Use Reline::Core.encoding instead of directly referencing IOGate * Set input/output based on the IOGate's interface
* [ruby/reline] Omit constant under StructYuta Kusuno2023-06-201-1/+1
| | | | | | (https://github.com/ruby/reline/pull/554) https://github.com/ruby/reline/commit/8761a11fa5
* [ruby/reline] Use appropriate dialog height and reduce screen pushuptomoya ishida2023-05-271-1/+1
| | | | | | | | | problem (https://github.com/ruby/reline/pull/542) * Provide preferred_dialog_height for dialog positioning * Fix rendering test
* [ruby/reline] Change Reline.add_dialog_proc(name, nil) to properlytomoya ishida2023-04-151-2/+6
| | | | | | | remove dialog_proc (https://github.com/ruby/reline/pull/532) https://github.com/ruby/reline/commit/43283b2f37
* [ruby/reline] Fix the cause of test_yamatanooroti randomly failingtomoya ishida2023-02-271-11/+13
| | | | | | | | (https://github.com/ruby/reline/pull/474) * Add repeated input-delete test that fails on HEAD * Use raw mode while readmultiline
* [ruby/reline] Add comment for unused constantsima1zumi2023-02-071-0/+1
| | | | | | | | FILENAME_COMPLETION_PROC and USERNAME_COMPLETION_PROC are not used by Reline. However, they were added for compatibility with the rb-readline gem. These constants have been retained and comments added. https://github.com/ruby/reline/commit/98fdbd3f18
* [ruby/reline] Remove unapproved color setting APIsStan Lo2022-12-051-26/+5
| | | | | | | | | | | | | These APIs/configs are not approved by the Ruby core, so they can't be released to the public. This means having them in the codebase will block other fixes/features from being released as well. So this commit removes those exposed interfaces to unblock the release. Hopefully when https://bugs.ruby-lang.org/issues/18996 is approved we can re-implement better APIs. https://github.com/ruby/reline/commit/f7a961c550
* [ruby/reline] Support dumb terminalNobuyoshi Nakada2022-09-011-16/+13
| | | | | | | | The "dumb" terminal is considered only on MSys tty now. However, the `TERM` feature has been used on many Unix-like systems for decades, not MSys specific. https://github.com/ruby/reline/commit/53fd51ab62
* [ruby/reline] Rename dialog_pointer_* to dialog_highlight_*st00122022-07-221-10/+10
| | | | | | | | "Pointer" is not what we usually use to describe a selected item. "Highlight" is a more common word for the scenario so we should use it instead. https://github.com/ruby/reline/commit/b4279d1557
* [ruby/reline] Use color name instead of code (integer) in dialog color APIsst00122022-07-161-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | As pointed out in the [comment](https://github.com/ruby/reline/pull/413#issuecomment-1168033973), the code is actually a control sequence and not only for colors. To make the dialog color APIs safer to use, we should restrict its usages and extract away the bg/fg concept from the input. So in this commit, I made these changes: 1. The dialog_*_bg/fg_color APIs only takes and returns color names (symbol): - :black - :red - :green - :yellow - :blue - :magenta - :cyan - :white 2. Add additional dialog_*_bg/fg_color_sequence APIs to access the raw code. https://github.com/ruby/reline/commit/b32a977766
* [ruby/reline] Enable to change the background color of dialogs. ↵pocari2022-06-271-10/+43
| | | | | | (https://github.com/ruby/reline/pull/413) https://github.com/ruby/reline/commit/bd49537964
* [ruby/reline] Check the ambiguous char width only on ttyNobuyoshi Nakada2022-06-131-1/+1
| | | | | | | | | It sent the char to check even to non-tty, e.g., pipe. This causes `unknown command: "\xE2\x96\xBDstart ` warnings on ruby's parallel test on Windows, where non-standard FDs cannot be passed to child processes. https://github.com/ruby/reline/commit/0d373647fb
* [ruby/reline] Finalize when exception occurredaycabta2021-12-211-1/+6
| | | | | | https://github.com/ruby/reline/commit/1f8a3aee43 Co-authored-by: Alex Gittemeier <me@a.lexg.dev>
* [ruby/reline] Split off set_signal_handler methodaycabta2021-12-211-0/+1
| | | | | | | | In some tests, the LineEditor#reset method is always called, but doesn't need to set the signal handlers there, so cuts it out to a separate method. https://github.com/ruby/reline/commit/b143c4f5f9
* [ruby/reline] Add support for overwriting dialog proc with the same nameaycabta2021-12-201-8/+6
| | | | https://github.com/ruby/reline/commit/16aa20c380
* [ruby/reline] Add Reline.dialog_proc(name_sym)aycabta2021-12-201-0/+7
| | | | https://github.com/ruby/reline/commit/7e5dbe4750
* [ruby/reline] Suppress warning, "instance variable @ambiguous_width not ↵aycabta2021-10-111-1/+1
| | | | | | initialized" https://github.com/ruby/reline/commit/368f7e2f78
* [ruby/reline] Refactoring Reline::Key.match? and add test.manga_osyo2021-10-021-13/+9
| | | | https://github.com/ruby/reline/commit/90e8999ae4
* [ruby/reline] Move #pointer from DialogRenderInfo to Dialogaycabta2021-09-101-2/+3
| | | | https://github.com/ruby/reline/commit/92dbac0bff
* [ruby/reline] Use Symbol for method namesaycabta2021-09-071-1/+1
| | | | https://github.com/ruby/reline/commit/479eee5393
* [ruby/reline] Limit number of chars only when completion source text ↵aycabta2021-09-061-1/+1
| | | | | | (pointer == -1) https://github.com/ruby/reline/commit/1d7b603811
* [ruby/reline] Cut out read_2nd_character_of_key_sequenceaycabta2021-09-061-27/+35
| | | | https://github.com/ruby/reline/commit/92518d1dee
* [ruby/reline] Use combined_key if it exists when comparing Reline::Key and ↵aycabta2021-09-061-1/+1
| | | | | | Integer https://github.com/ruby/reline/commit/8fca5f6f9c
* [ruby/reline] Allow Reline::KeyStroke to compare raw and meta-key processed ↵aycabta2021-09-061-2/+10
| | | | | | key sequences https://github.com/ruby/reline/commit/731103f9c9
* [ruby/reline] Support for key bindings result Symbol in Reline::Keyaycabta2021-09-061-1/+1
| | | | https://github.com/ruby/reline/commit/cf78a38064
* [ruby/reline] Add Reline::Key#== as an alias to Reline::Key#match?aycabta2021-09-061-0/+1
| | | | https://github.com/ruby/reline/commit/1fc3276c01
* [ruby/reline] Reline::Key supports the comparison with Integeraycabta2021-09-061-3/+15
| | | | https://github.com/ruby/reline/commit/ebc3e0f673
* [ruby/reline] Implement scrollbaraycabta2021-09-041-2/+2
| | | | https://github.com/ruby/reline/commit/4c7fc42151
* [ruby/reline] Show even if it's only one candidate until a perfect matchaycabta2021-09-041-1/+1
| | | | https://github.com/ruby/reline/commit/fe7e34e79f
* [ruby/reline] Add Reline::Key#match?aycabta2021-09-031-1/+7
| | | | https://github.com/ruby/reline/commit/8f6aa3af2e
* [ruby/reline] Autocompletion ignites when target char length is 3 or longeraycabta2021-09-031-1/+1
| | | | https://github.com/ruby/reline/commit/261830fda3
* [ruby/reline] Add a spaceaycabta2021-09-021-1/+1
| | | | https://github.com/ruby/reline/commit/3d70e07331
* [ruby/reline] Fix Reline::Unicode.take_range as it was not fully functionalaycabta2021-08-311-1/+1
| | | | https://github.com/ruby/reline/commit/5da6a8d851
* [ruby/reline] Pass "dialog" to context to get "dialog.scroll_top" lateraycabta2021-08-311-1/+1
| | | | https://github.com/ruby/reline/commit/d81f29a134
* [ruby/reline] Autocompletion dialog height 15aycabta2021-08-311-1/+1
| | | | https://github.com/ruby/reline/commit/7e18716754
* [ruby/reline] Scroll autocompletion pointer in dialog correctlyaycabta2021-08-311-1/+1
| | | | https://github.com/ruby/reline/commit/dc79ed2dd8
* [ruby/reline] Use DialogRenderInfo structaycabta2021-08-311-1/+2
| | | | https://github.com/ruby/reline/commit/ac6f652a39
* [ruby/reline] Fix Reline.autocompletion=() interfaceaycabta2021-08-301-0/+1
| | | | https://github.com/ruby/reline/commit/71c2eb143d
* [ruby/reline] Add Reline.autocompletion=() interfaceaycabta2021-08-301-0/+8
| | | | https://github.com/ruby/reline/commit/a2e69f6277
* [ruby/reline] Add autocompletion on emacs mode by Tab / S-Tabaycabta2021-08-301-0/+1
| | | | https://github.com/ruby/reline/commit/22d0b4e5d8
* [ruby/reline] Make autocomplete dialog is registered firstaycabta2021-08-291-2/+3
| | | | https://github.com/ruby/reline/commit/d027dbe118
* [ruby/reline] Delete show doc dialog to move it to IRBaycabta2021-08-291-37/+0
| | | | https://github.com/ruby/reline/commit/640102fe27
* [ruby/reline] Remove an unnecessary variableaycabta2021-08-291-1/+0
| | | | https://github.com/ruby/reline/commit/3b8cc5ce0a
* [ruby/reline] Remove dialog_proc_list accessor of Relineaycabta2021-08-291-1/+0
| | | | https://github.com/ruby/reline/commit/ac8fa84f4d
* [ruby/reline] Move constants of dialogs to under Relineaycabta2021-08-291-5/+5
| | | | https://github.com/ruby/reline/commit/9100ea2934