aboutsummaryrefslogtreecommitdiffstats
path: root/test/reline
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/reline] Remove unapproved color setting APIsStan Lo2022-12-052-43/+0
| | | | | | | | | | | | | 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] use assert_nothing_raisedOtávio Schwanck dos Santos2022-09-221-5/+1
| | | | https://github.com/ruby/reline/commit/f08be5da09
* [ruby/reline] PR changesOtávio Schwanck dos Santos2022-09-221-0/+12
| | | | https://github.com/ruby/reline/commit/e8e8d81f47
* [ruby/reline] Support dumb terminalNobuyoshi Nakada2022-09-011-0/+6
| | | | | | | | 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-222-13/+13
| | | | | | | | "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-162-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | 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] Add tests for top-level dialog color APIsst00122022-07-111-0/+17
| | | | https://github.com/ruby/reline/commit/347a468c59
* [ruby/reline] Enable to change the background color of dialogs. ↵pocari2022-06-271-0/+15
| | | | | | (https://github.com/ruby/reline/pull/413) https://github.com/ruby/reline/commit/bd49537964
* [ruby/reline] Fix support for emacs-ctlx and emacs-meta keymapsTim Pope2022-02-221-0/+22
| | | | | | | | | | | | The existing implementation, given the below .inputrc, erroneously creates a "C-v" key binding: set keymap emacs-ctlx "\C-v": "[C-x C-v was pressed]" This fixes it to instead create a "C-x C-v" keybinding. https://github.com/ruby/reline/commit/719f52d231
* [ruby/reline] Use "Bundler.require" to load Gemfile.lock in multiline_replaycabta2022-01-161-0/+4
| | | | https://github.com/ruby/reline/commit/492bee257a
* [ruby/reline] Fix incremental search to work correctly even if not last lineaycabta2022-01-161-0/+23
| | | | https://github.com/ruby/reline/commit/21d75f6d4c
* [ruby/reline] Insert newline in the middle of buffer just after dialogaycabta2022-01-161-0/+21
| | | | https://github.com/ruby/reline/commit/0c76631132
* [ruby/reline] Add a wait for a test because sometimes failsaycabta2022-01-161-0/+1
| | | | https://github.com/ruby/reline/commit/da4a7aa932
* [ruby/reline] Clear dialog when adding new line to end of bufferaycabta2022-01-161-0/+17
| | | | https://github.com/ruby/reline/commit/7d38454327
* [ruby/reline] Clear dialog when just_move_cursor is called with dialog at ↵aycabta2022-01-111-0/+17
| | | | | | last line https://github.com/ruby/reline/commit/05024b968e
* [ruby/reline] windows: test_yamatanooroti fixYO42022-01-061-2/+2
| | | | | | windows can't create too narrow and tall window. https://github.com/ruby/reline/commit/20b5f2f6fc
* [ruby/reline] Remove test TODO comments that have been confirmed by E2E testsaycabta2022-01-031-12/+0
| | | | https://github.com/ruby/reline/commit/2ed77b693f
* [ruby/reline] Check capname of tigetstr/tigetflag/tigetnumaycabta2022-01-021-0/+3
| | | | | | Incorrect arguments can cause SEGV. https://github.com/ruby/reline/commit/a58748bcf9
* [ruby/reline] Add test_tigetstr_with_erroraycabta2022-01-021-0/+4
| | | | https://github.com/ruby/reline/commit/1ca779740a
* [ruby/reline] Implement Reline::Terminfo.tigetnumaycabta2022-01-021-0/+11
| | | | https://github.com/ruby/reline/commit/695212d5d2
* [ruby/reline] Consolidate tests that were unnecessarily dividedaycabta2022-01-011-3/+0
| | | | https://github.com/ruby/reline/commit/62eec42e4a
* [ruby/reline] Implement Reline::Terminfo.tigetflagaycabta2022-01-011-0/+14
| | | | https://github.com/ruby/reline/commit/0451ed7a28
* [ruby/reline] Omit a test on Ruby 2.6aycabta2021-12-301-0/+1
| | | | | | | Some tokens in Ruby 2.6 have difference information than in 2.7 and later, but 2.6 will soon be out of support. https://github.com/ruby/reline/commit/f3bc698385
* [ruby/reline] Use ripper_lex_without_warningaycabta2021-12-301-1/+1
| | | | https://github.com/ruby/reline/commit/b7536dc224
* [ruby/reline] Use unix_line_discard when Ctrl-u is enteredima1zumi2021-12-301-0/+22
| | | | | | | | | | | | The kill-line was called when C-u was entered, so it is now called unix-line-discard. In readline(3): > unix-line-discard (C-u) > Kill backward from point to the beginning of the line. > The killed text is saved on the kill-ring. https://github.com/ruby/reline/commit/27570d195e
* [ruby/reline] Use omit instead of skipHiroshi SHIBATA2021-12-292-5/+5
| | | | https://github.com/ruby/reline/commit/a538de421f
* [ruby/reline] Escape newline(s) in dynamic promptaycabta2021-12-252-0/+20
| | | | https://github.com/ruby/reline/commit/9b209ee1ea
* [ruby/reline] Escape newline(s) in promptaycabta2021-12-251-0/+13
| | | | https://github.com/ruby/reline/commit/b545459fca
* [ruby/reline] Implement em_kill_lineaycabta2021-12-241-0/+28
| | | | https://github.com/ruby/reline/commit/9fca6ceb45
* [ruby/reline] Rename the wrong name "em-kill-line" with the correct name ↵aycabta2021-12-241-0/+28
| | | | | | "unix-line-discard" https://github.com/ruby/reline/commit/da7af35d1f
* [ruby/reline] Bind ed-kill-line to C-u on emacs modeaycabta2021-12-241-28/+0
| | | | https://github.com/ruby/reline/commit/9ab99574f5
* [ruby/reline] Fix test input_keys to handle "hankaku" characters correctly ↵Yusuke Endoh2021-12-242-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on Windows The method "input_keys" in test/reline/helper.rb handles a single-byte and 8-bit charater as an input with the meta key. However, "test_halfwidth_kana_width_dakuten" in test/reline/test_key_actor_emacs.rb uses a string that contains "hankaku" characters. A "hankaku" character is not with the meta key, but it is a single-byte and 8-bit character on Windows-31J encoding, which confused "input_keys" method. This caused the following error. https://ci.appveyor.com/project/ruby/ruby/builds/41997092/job/ejm77qxgvnlpdwvg ``` 1) Failure: Reline::KeyActor::Emacs::Test#test_halfwidth_kana_width_dakuten [C:/projects/ruby/test/reline/test_key_actor_emacs.rb:2311]: <"\xB6\xDE\xB7\xDE\xB9\xDE\xBA\xDE" (#<Encoding:Windows-31J>)> expected but was <"\e^\e^\e^\e:\e^" (#<Encoding:Windows-31J>)> in <Terminal #<Encoding:Windows-31J>> . <8> expected but was <10>. Finished tests in 1045.472722s, 19.3922 tests/s, 2609.4320 assertions/s. ``` This change introduces "input_raw_keys" that does not convert a single-byte and 8-bit character to "with the meta key", and use it in the test in question. https://github.com/ruby/reline/commit/f6ae0e5d19
* [ruby/reline] Add encoding info to an assertion of editing lineaycabta2021-12-241-1/+5
| | | | https://github.com/ruby/reline/commit/22d9262d79
* [ruby/reline] Add a test for halfwidth kana width dakutenaycabta2021-12-241-0/+16
| | | | https://github.com/ruby/reline/commit/0895a0d4a1
* [ruby/reline] Add a test for dialog proc with contextaycabta2021-12-201-0/+14
| | | | https://github.com/ruby/reline/commit/2ce2696d6e
* [ruby/reline] Add an assertion for overwriting dialog proc with the same nameaycabta2021-12-201-0/+5
| | | | https://github.com/ruby/reline/commit/96067bc13c
* [ruby/reline] Rename the variable "p" because it overlaps with the "p" methodaycabta2021-12-201-21/+21
| | | | https://github.com/ruby/reline/commit/9bf2ca692e
* [ruby/reline] Add support for overwriting dialog proc with the same nameaycabta2021-12-201-3/+6
| | | | https://github.com/ruby/reline/commit/16aa20c380
* [ruby/reline] Add Reline.dialog_proc(name_sym)aycabta2021-12-201-0/+5
| | | | https://github.com/ruby/reline/commit/7e5dbe4750
* [ruby/reline] Add a test for Reline.add_dialog_procaycabta2021-12-201-0/+15
| | | | https://github.com/ruby/reline/commit/c4bb1bfd79
* [ruby/reline] Clear dialog in pastingaycabta2021-12-191-0/+11
| | | | https://github.com/ruby/reline/commit/dabf5313e0
* [ruby/reline] Change a test method name to more appropriateaycabta2021-12-181-1/+1
| | | | https://github.com/ruby/reline/commit/d014cc85b7
* Prepare for removing RubyVM::JIT (#5262)Takashi Kokubun2021-12-131-1/+1
|
* [ruby/reline] Remove unnecessary variables, lower_spaceaycabta2021-12-131-0/+20
| | | | | | | | The number of lines below the cursor position was known by "@rest_height" alone, but the problem was caused by adding "lower_space". Remove "lower_space" as it is unnecessary. https://github.com/ruby/reline/commit/a575cef6a3
* [ruby/reline] @convert_meta is true unless 8-bit charactersima1zumi2021-12-101-0/+18
| | | | | | | | | | | | If Reline::IOGate.encoding contains 7-bit characters, convert-meta will set it On. Because in readline(3): > The default is On, but readline will set it to Off if the locale contains eight-bit characters. As far as I know, 7-bit encoding used in terminals is only US-ASCII. https://github.com/ruby/reline/commit/b71d1fa496
* [ruby/reline] Execute compress_meta_key if convert_meta is onima1zumi2021-12-101-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | fix `#357` When using 8-bit characters, it is better not to use `compress_meta_key`. I believe not to use `compress_meta_key` unless `set convert-meta on` is written in the `.inputrc`. The following is a quote from tmtm's comments. > The behavior of this compress_meta_key method is similar to the behavior of convert-meta=on in readline, but readline turns off convert-meta if the locale contains 8bit characters. > In readline(3): > convert-meta (On) > If set to On, readline will convert characters with the eighth > bit set to an ASCII key sequence by stripping the eighth bit and > prefixing it with an escape character (in effect, using escape > as the meta prefix). The default is On, but readline will set > it to Off if the locale contains eight-bit characters. https://github.com/ruby/reline/commit/9491cc8542 Co-authored-by: TOMITA Masahiro <tommy@tmtm.org>
* [ruby/reline] Correct padding space calculationima1zumi2021-11-212-0/+37
| | | | | | | | | | | | fix https://github.com/ruby/irb/issues/308 This bug occurred when `dialog.width - calculate_width(s, true)` was negative. When `dialog.width` is shorter than `old_dialog.width`, it calculates how much padding it has to do. However, there are cases where `s` is longer than `dialog.width`, as in the issue. In that case, `padding_space_with_escape_sequences` will crash. Here, `old_dialog.width` is longer than `dialog.width`, so I changed the padding width to `old_dialog.width - dialog.width`. https://github.com/ruby/reline/commit/c581c31e0f
* [ruby/reline] Skip when unable to set inputNobuyoshi Nakada2021-10-131-1/+6
| | | | | | | `Reline::Windows` always reads from the console by Windows API using fiddle. https://github.com/ruby/reline/commit/c3bf85f5af
* [ruby/reline] Close working pipesNobuyoshi Nakada2021-10-121-2/+7
| | | | https://github.com/ruby/reline/commit/ac519f57ea
* [ruby/reline] Fix test class not to overwriteNobuyoshi Nakada2021-10-111-1/+1
| | | | https://github.com/ruby/reline/commit/1e78984c49