summaryrefslogtreecommitdiff
path: root/test/reline
AgeCommit message (Collapse)Author
2024-06-18[ruby/reline] Fix vi_yank or vi_delete_meta copies nil bugtomoya ishida
(https://github.com/ruby/reline/pull/726) https://github.com/ruby/reline/commit/46b30b07c9
2024-06-06[ruby/reline] Remove instance variable @first_chartomoya ishida
(https://github.com/ruby/reline/pull/717) When Reline reads EOF, Reline.readline should return nil if and only if input is empty https://github.com/ruby/reline/commit/cc74b3686a
2024-06-05[ruby/reline] Refactor input key readingtomoya ishida
(https://github.com/ruby/reline/pull/712) * Add key binding matching status :matching_matched * Simplify read_2nd_character * Add a comment of matching status and EOF * Matching status to a constant * Expand complicated ternary operators to case-when https://github.com/ruby/reline/commit/64deec100b
2024-06-04[ruby/reline] Ensure no escape sequence before printing prompttomoya ishida
(https://github.com/ruby/reline/pull/716) https://github.com/ruby/reline/commit/f9227b5c89
2024-06-04Revert "Revert "[ruby/reline] Reline::ANSI is general io. Reline::GeneralIO ↵Takashi Kokubun
is not."" This reverts commit 6e84ac2359c8fc8cb686ef4644b9cae26cd5ab9e. Now that the rubygems spec change has been merged, let's try reverting this and fixing it with tompng's new patch.
2024-06-03Revert "[ruby/reline] Reline::ANSI is general io. Reline::GeneralIO is not."Takashi Kokubun
This reverts commit ba01d15cf5db96933905d669c68f5cc0cd6910b8. It seems to be failing test-bundler-parallel. Reverting it to normalize the CI. We should revert this revert once we figure it out.
2024-06-03[ruby/reline] Reline::ANSI is general io. Reline::GeneralIO is not.tomoya ishida
(https://github.com/ruby/reline/pull/659) Reline::ANSI has a partial non-tty supporting code. It should be a general io. Reline::Dumb should be only used in testing. https://github.com/ruby/reline/commit/2d6828473d
2024-06-03[ruby/reline] In ed_search_[prev|next]_history, make the cursor comeHiroaki Osawa
to the end of the line when there is no search substr (https://github.com/ruby/reline/pull/714) * In ed_search_prev_history, make the cursor come to the end of the line when there is no search substr * In ed_search_next_history, make the cursor come to the end of the line when there is no search substr * Implemented ActionState to search with empty substr if the previous operation was search with empty string. * Use a simple 2-element array to represent action_state https://github.com/ruby/reline/commit/95ee80bd70
2024-06-03[ruby/reline] Improve key binding match/matching checktomoya ishida
(https://github.com/ruby/reline/pull/709) * Improve key binding match/matching check * Rename key_actors to default_key_bindings * Make key_stroke.expand always return a value * Update add_default_key_binding to use a add_default_key_binding_by_keymap internally Co-authored-by: Stan Lo <[email protected]> --------- https://github.com/ruby/reline/commit/353ec236e2 Co-authored-by: Stan Lo <[email protected]>
2024-06-01[ruby/reline] Overhaul io gate structureStan Lo
(https://github.com/ruby/reline/pull/666) * Overhaul IO gate structure 1. Move IO related classes to `lib/reline/io/` directory. 2. Rename `GeneralIO` to `Dumb`. 3. Use IO classes as instances instead of classes. * Update lib/reline/io/ansi.rb Co-authored-by: tomoya ishida <[email protected]> --------- https://github.com/ruby/reline/commit/dc1518e1ac Co-authored-by: tomoya ishida <[email protected]>
2024-05-27[ruby/reline] Implement the redo commandverdy89
(https://github.com/ruby/reline/pull/707) * Implement the redo command * Commented out a test that does not pass * Changed key assignment for redo from "\C-[" to "\C-g" * Changed redo key assignment from `\C-g` to `\M-\C-_` * Revert the first implemantation * Implemented redo by sharing `@past_lines` between undo and redo * Fixed the index of past_lines that is updated when the cursor is moved * Fixed deletion of the redo history in regular input * Renamed variables: past_lines -> input_lines * Rename @position to @input_lines_position * Deleted unused variables: `@old_byte_pointer` and `@old_line_index` https://github.com/ruby/reline/commit/0b2d9fab5f
2024-05-26[ruby/reline] allow space in config valueGo
(https://github.com/ruby/reline/pull/705) * allow space in config value fix https://github.com/ruby/reline/pull/657 * remove inline comments * Revert "remove inline comments" This reverts commit https://github.com/ruby/reline/commit/2438347c1a10. * refactoring * remove unnecessary comment handling https://github.com/ruby/reline/commit/d60f1e1e39
2024-05-14[ruby/reline] Implement the undo commandMari Imaizumi
(https://github.com/ruby/reline/pull/701) * Refactor send * Implement the undo command * Fix @past_lines initialization * Improve assertion * Hide to save buffer in insert_pasted_text * Replace @using_delete_command with @undoing * Refactor `@past_lines` https://github.com/ruby/reline/commit/4ab72f9cbd
2024-05-10[ruby/reline] Avoid STDIN.winsize called in `require "reline"`tomoya ishida
(https://github.com/ruby/reline/pull/703) https://github.com/ruby/reline/commit/21891c47c4
2024-05-08[ruby/reline] Implement bracketed paste inserttomoya ishida
(https://github.com/ruby/reline/pull/655) https://github.com/ruby/reline/commit/e92dcbf514
2024-05-05[ruby/reline] Add name defined in readline to completion keytomoya ishida
bindings C-i C-p C-n (https://github.com/ruby/reline/pull/698) https://github.com/ruby/reline/commit/1314787bbb
2024-05-02[ruby/reline] Fix default and additional key bindings vanish bugtomoya ishida
(https://github.com/ruby/reline/pull/697) https://github.com/ruby/reline/commit/fc9b4d2274
2024-05-02[ruby/reline] Fix prompt width calculation bug. Test with coloredtomoya ishida
prompt (https://github.com/ruby/reline/pull/695) https://github.com/ruby/reline/commit/24aab01cbc
2024-04-30[ruby/reline] Fix completion dialog position when completed part istomoya ishida
wordwrapped (https://github.com/ruby/reline/pull/692) https://github.com/ruby/reline/commit/2d9acd16fe
2024-04-29[ruby/reline] Input with eof and no newline bugfixtomoya ishida
(https://github.com/ruby/reline/pull/671) https://github.com/ruby/reline/commit/0d66c335a1
2024-04-29[ruby/reline] Completely support full-width characters intomoya ishida
differential rendering (https://github.com/ruby/reline/pull/654) * Add a cut variation of Reline::Unicode.take_range method take_mbchar_range * Consider fullwidth take_range in differential rendering https://github.com/ruby/reline/commit/29714df09f
2024-04-29[ruby/reline] Handle mode condition in inputrcMari Imaizumi
(https://github.com/ruby/reline/pull/687) https://github.com/ruby/reline/commit/bed5fb3d77
2024-04-25[ruby/reline] Fix inputrc nested $if $else $endif bugtomoya ishida
(https://github.com/ruby/reline/pull/689) https://github.com/ruby/reline/commit/0d8aea26ec
2024-04-24[ruby/reline] Long line performancetomoya ishida
(https://github.com/ruby/reline/pull/688) * Improve C-e (ed_move_to_end) performance for long line * Reline::Unicode.split_by_width optimization for RESET_SGR https://github.com/ruby/reline/commit/0c8d3c827a
2024-04-19[ruby/reline] Implement `show-all-if-ambiguous` featureMari Imaizumi
(https://github.com/ruby/reline/pull/683) https://github.com/ruby/reline/commit/0fe4fdc794
2024-04-17[ruby/reline] Refactor nomultiline and multiline mode differencetomoya ishida
(https://github.com/ruby/reline/pull/653) * Support multiline input in Reline.readline internally, reduce multiline-singleline branch * Add readline(singleline) prompt test with force inserting multiline text https://github.com/ruby/reline/commit/97846095d7
2024-04-16[ruby/reline] Implement changing editing modeMari Imaizumi
(https://github.com/ruby/reline/pull/681) https://github.com/ruby/reline/commit/501b9a6c5f
2024-04-15[ruby/reline] Fix vi_to_column which was brokentomoya ishida
(https://github.com/ruby/reline/pull/679) https://github.com/ruby/reline/commit/9e93ad52e7
2024-04-14[ruby/reline] Refactor waiting_proc and waiting_operator_proctomoya ishida
(https://github.com/ruby/reline/pull/649) * Fix waiting_proc precedence * Fix waiting_operator bugs * Add waiting_proc and vi_waiting_operator test * Fix vi waiting operator arg number vi_arg and vi_waiting_operator_arg should be multiplied * Implement `yy` copies whole line in vi_command mode * Simplify incremental search cancel test * Add complex vi test with waiting_proc and vi_waiting_operator, split test input https://github.com/ruby/reline/commit/777dffae1c
2024-04-14[ruby/reline] Support `menu-complete-backward` command for upwardMichael J. Giarlo
navigation (https://github.com/ruby/reline/pull/677) Fixes https://github.com/ruby/reline/pull/675 This commit extracts the upward navigation condition in `LineEditor#input_key` to a new private method, and adds a new alias. This change allows Reline to support upward navigation in when a user has configured `inputrc` to map Shift-Tab to `menu-complete-backward`, a common setting in Bash (>= 4.x). Instead of special-casing upward navigation in `LineEditor#input_key`, we now allow it to be processed by the branch that calls `process_key`. The extracted method no longer includes the editing mode check since this check is already made by `#wrap_method_call` by the time `#completion_journey_up` (or `#menu_complete_backward`) is called. Since upward navigation is happening in a method other than `#input_key` now, the `completion_occurs` variable that used to be local to `#input_key` is changed to an instance variable so that the new method can change its value. (I see many examples of mutating such instance variables in `LineEditor`, so I assumed this would be an uncontroversial change consistent with the coding practices already in place.) Test coverage of this change has been added to the emacs and vi `KeyActor` tests. Many thanks to @ima1zumi for their very helpful comments on #675 which encouraged me to contribute this work! https://github.com/ruby/reline/commit/2ccdb374a4
2024-04-06[ruby/reline] Continue processing even if terminfo database couldn'tMari Imaizumi
be found (https://github.com/ruby/reline/pull/673) Fix https://github.com/ruby/reline/issues/447 https://github.com/ruby/reline/issues/543 This problem occurs when Fiddle can be loaded, curses can be loaded, and TERM is not registered in Terminfo. It should also occur at hardcopy terminals and when Terminfo information is low, but no such reports have been received. Reline should not abort the process because of missing Terminfo. Reline proceeds with `Reline::Terminfo.enabled? == false` when fiddle or curses cannot be loaded. And does the same when Terminfo is present but TERM is not. https://github.com/ruby/reline/blob/ebab2875f1226f877376558d8758bc0e2a1776c7/lib/reline/terminfo.rb#L156-L160 You can check the operation with `TERM=foo bundle exec bin/console`. https://github.com/ruby/reline/commit/4ce247ce2b
2024-04-05[ruby/reline] Thread safe readlinetomoya ishida
(https://github.com/ruby/reline/pull/669) Block until other Reline.readline or Reline.readmultiline finish https://github.com/ruby/reline/commit/ebab2875f1
2024-04-04[ruby/reline] Handle INT signal correctly, remove handle_clearedtomoya ishida
because clear(C-l) is not a signal (https://github.com/ruby/reline/pull/646) https://github.com/ruby/reline/commit/3debb0ae2f
2024-04-04[ruby/reline] Fix audoindent including "\v", escape "\v" fortomoya ishida
rendering (https://github.com/ruby/reline/pull/648) https://github.com/ruby/reline/commit/9c51c577ca
2024-04-01[ruby/reline] Refactor completiontomoya ishida
(https://github.com/ruby/reline/pull/647) * Refactor completion: split autocompletion and tabcompletion logic and state * Move completion candidate listup logic from dialog proc to LineEditor https://github.com/ruby/reline/commit/c3c09ac9c2
2024-04-01[ruby/reline] Align completion menu itemstomoya ishida
(https://github.com/ruby/reline/pull/613) https://github.com/ruby/reline/commit/a622704f62
2024-03-25[ruby/reline] Remove useless testsStan Lo
(https://github.com/ruby/reline/pull/665) The pasting tests hadn't been working since as early as v0.2.0. Since what it tried to cover is already gone for such a long time, I think it's better to write new ones if needed then to keep them around. And since these tests are gone, the helper methods for just them are also gone. https://github.com/ruby/reline/commit/0eedf0e4a0
2024-03-24[ruby/reline] Add mode_string to prompt calculation dependenciestomoya ishida
(https://github.com/ruby/reline/pull/658) * Add mode_string to prompt calculation dependencies * Update vi show-mode-in-prompt test https://github.com/ruby/reline/commit/a0cee06ec5
2024-03-24[ruby/reline] Refactor key actor testtomoya ishida
(https://github.com/ruby/reline/pull/645) * Add assertion assert_cursor_line to test helper * Autofix key_actor test to use assert_cursor_line * Rename the assertion to assert_line_around_cursor and remove other assertions for line and cursor https://github.com/ruby/reline/commit/e4773800c6
2024-03-23[ruby/reline] Do not send color reset sequence when GeneralIO istomoya ishida
used (https://github.com/ruby/reline/pull/661) https://github.com/ruby/reline/commit/3719702808
2024-03-23[ruby/reline] Make mutated string in yamatanooroti explicitlyStan Lo
mutable (https://github.com/ruby/reline/pull/662) This avoids the frozen literal warning in Ruby 3.4. https://github.com/ruby/reline/commit/cccb985804
2024-03-19[ruby/reline] Reline 0.5.0.pretomoya ishida
(https://github.com/ruby/reline/pull/614) * Re-architecture LineEditor's internal state and rendering * Fix test related to LineEditor re-architecture * Bump to 0.5.0.pre.1 * Hide cursor only when updating screen. Frequent hide&show makes cursor flickering. * Simplify rerender call from reline.rb * Simplify handle_cleared It only need to clear screen. line_editor.rerender will be called later. * Add description of updating pasting_state inserts continuous_insertion_buffer * Use meaningful block parameter Co-authored-by: Stan Lo <[email protected]> * Fix use of `@cursor_y` Fix bug updating `@cursor_y`. Do not use `@cursor_y` while updating dialog because it is not current cursor position but cursor position at last rendered time. * Remove useless instance_variable_set in test These instance variables are already removed from LineEditor * Always initialize instance variables to avoid ruby 2.7 warning, remove unused instance variable * Call update_dialogs from reline.rb before first render * Combine state representing rendered screen information into `@rendered_screen` * Rename editor_cursor_ to wrapped_cursor It represents cursor position of word wrapped whole content * Remove unused code, tweak, add comment --------- https://github.com/ruby/reline/commit/3fa376217d Co-authored-by: Stan Lo <[email protected]>
2024-02-13[ruby/reline] C for vi modeOtávio Schwanck dos Santos
(https://github.com/ruby/reline/pull/472) https://github.com/ruby/reline/commit/d197be7c44
2024-01-04[ruby/reline] Fix pasting tab-indented code crashtomoya ishida
(https://github.com/ruby/reline/pull/630) https://github.com/ruby/reline/commit/90155fd0d9
2023-11-13[ruby/reline] Fallback to 256color if COLORTERM != truecolortomoya ishida
(https://github.com/ruby/reline/pull/604) * Fallback to 256color if COLORTERM != truecolor * Add Reline::Face.force_truecolor to force truecolor without COLORTERM env https://github.com/ruby/reline/commit/090e1e4df0
2023-11-06[ruby/reline] Test Reline::Face without mockingStan Lo
(https://github.com/ruby/reline/pull/600) * Test Reline::Face without mocking Because `test-unit-rr` is not a default gem, using it would break CRuby's CI. * Add ruby-core workflow https://github.com/ruby/reline/commit/d2189ac436
2023-11-06[ruby/reline] Introduce a new class Reline::Face to configureHASUMI Hitoshi
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 <[email protected]> * Update test/reline/test_face.rb Co-authored-by: Stan Lo <[email protected]> * 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 <[email protected]> * Update test/reline/test_face.rb Co-authored-by: Stan Lo <[email protected]> * 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 <[email protected]> --------- https://github.com/ruby/reline/commit/fdc1d3b1e5 Co-authored-by: Stan Lo <[email protected]> Co-authored-by: ima1zumi <[email protected]>
2023-09-28[ruby/reline] Properly restore Reline::IOGate in test teardowntomoya ishida
(https://github.com/ruby/reline/pull/593) * Properly restore Reline::IOGate in test teardown * GeneralIO.reset should reset class variable existence https://github.com/ruby/reline/commit/c16d33dae5
2023-09-26[ruby/reline] Fix config.rb to File.expand_path $include path inelfham
inputrc (https://github.com/ruby/reline/pull/592) * Fix config.rb to File.expand_path $include path in inputrc * fix bug of test_include_expand_path on Windows https://github.com/ruby/reline/commit/4d34e52d0b
2023-08-20[ruby/reline] Remove Timeout usageStan Lo
(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