summaryrefslogtreecommitdiff
path: root/lib/reline/line_editor.rb
AgeCommit message (Collapse)Author
2023-05-07[ruby/reline] Fix dialog corrupts rendering by pushing up input linetomoya ishida
too much (https://github.com/ruby/reline/pull/524) * Do not render dialog where it overflows screen * Dialog rendering should Scroll down only when needed * Refactor screen_y_range calculation Co-authored-by: Stan Lo <[email protected]> --------- https://github.com/ruby/reline/commit/bc0e3d1310 Co-authored-by: Stan Lo <[email protected]>
2023-05-01[ruby/reline] Rewrite dialog renderingtomoya ishida
(https://github.com/ruby/reline/pull/492) * Rewrite dialog rendering * Fix failing test of dialog with small screen * Add multiple-dialog rendering test * Add description comments for each part of render_dialog_changes
2023-04-24[ruby/reline] Revert #335 (Trap TSTP to handle C-z)Carl Brasic
(https://github.com/ruby/reline/pull/535) This PR was an effort to address #321 (ed_quoted_insert doesn't work properly) but per the reporter it did not work correctly. Moreover, it introduced a major regression: Shell job control stopped working in all applications that use reline, notably IRB. Bash and other shells send SIGTSTP in response to C-z to implement job suspension. Handling SIGSTP opts out of this functionality. For a line oriented terminal program this should be avoided (not to mention, this behavior diverges from readline's) https://github.com/ruby/reline/commit/26383d25b8 Co-authored-by: Carl Brasic <[email protected]>
2023-04-05Use `em_delete` in `key_delete` (#504)Étienne Barrié
* Test existing behavior Typing Ctrl-D ends editing but typing <Del> does not. Also renamed a test that is not testing ed_delete_next_char but key_delete. * Check if line empty first in em_delete By distributivity of AND over OR, we can factor out this condition. This will make the next commit simpler. * Use em_delete in key_delete When the editing mode is emacs, use `em_delete` in `key_delete`. We need to add a condition though to `em_delete`, because it implements both `delete-char` and `end-of-file`. We only want the `end-of-file` behavior is the key is really Ctrl-D. This matches the behavior of the <Del> key with readline, i.e. deleting the next character if there is one, but not moving the cursor, while not finishing the editing if there are no characters.
2023-03-29[ruby/reline] Drop Dialog#scrollbar_pos as we can store it in aStan Lo
local variable (https://github.com/ruby/reline/pull/529) https://github.com/ruby/reline/commit/d0139975fd Co-authored-by: tomoya ishida <[email protected]>
2023-03-27[ruby/reline] Fix cursor position overruntomoya ishida
(https://github.com/ruby/reline/pull/515) * Fix cursor position overrun * Remove unnecessary local variable Co-authored-by: Stan Lo <[email protected]> --------- https://github.com/ruby/reline/commit/d4ad9b96c8 Co-authored-by: Stan Lo <[email protected]>
2023-03-18[ruby/reline] Fix: line longer than terminal width breaks renderingtomoya ishida
(https://github.com/ruby/reline/pull/516) https://github.com/ruby/reline/commit/ae5f9b87ab
2023-03-04[ruby/reline] Fix completion with multilinetomoya ishida
(https://github.com/ruby/reline/pull/513) https://github.com/ruby/reline/commit/d76c482c5f
2023-02-27[ruby/reline] Fix wrong indent number in prompt. whole_lines hastomoya ishida
duplicated line. (https://github.com/ruby/reline/pull/460) * whole_lines should consider prev_line_index, and must not duplicate last_line * Add test for lines passed to dynamic prompt proc * Refactor whole_lines parameters used in test helper * Remove whole_line's arguments
2023-02-27[ruby/reline] Fix the cause of test_yamatanooroti randomly failingtomoya ishida
(https://github.com/ruby/reline/pull/474) * Add repeated input-delete test that fails on HEAD * Use raw mode while readmultiline
2023-02-06[ruby/reline] Fix line rendering when newline is added at the end of the buffertompng
https://github.com/ruby/reline/commit/7d61b3df9a
2023-01-20[ruby/reline] accept new_indent > cursor_maxtompng
https://github.com/ruby/reline/commit/61cc580da4
2023-01-18[ruby/reline] Add constant MINIMUM_SCROLLBAR_HEIGHT for scrollbar rendering ↵tompng
when dialog content is very long https://github.com/ruby/reline/commit/d4c95f89ec
2023-01-18[ruby/reline] Fix dialog scrollbar rendering position and disappearing bugtompng
https://github.com/ruby/reline/commit/e21b69ade4
2023-01-12[ruby/reline] Pass unmodifined lines(that does not include escapetomoya ishida
sequence) to check_multiline_prompt (https://github.com/ruby/reline/pull/458) * pass unmodified lines to check_multiline_prompt * Add test to check that output modified by output_modifier_proc is not passed to prompt_proc
2022-09-22[ruby/reline] PR changesOtávio Schwanck dos Santos
https://github.com/ruby/reline/commit/e8e8d81f47
2022-09-22[ruby/reline] fix vi-operator-argOtávio Schwanck dos Santos
https://github.com/ruby/reline/commit/d42cdb8f91
2022-09-03[ruby/reline] Fix a typo [ci skip]Nobuyoshi Nakada
https://github.com/ruby/reline/commit/33bf80e757
2022-09-02[ruby/reline] Workaround for padding width with Aracritty on macOSHiroshi SHIBATA
https://github.com/ruby/reline/commit/fb4136c8a7
2022-09-01[ruby/reline] Remove loose operation in Dialog#render_each_dialogMau Magnaguagno
https://github.com/ruby/reline/commit/a6d1c917ce
2022-06-27[ruby/reline] Enable to change the background color of dialogs. ↵pocari
(https://github.com/ruby/reline/pull/413) https://github.com/ruby/reline/commit/bd49537964
2022-01-16[ruby/reline] Fix incremental search to work correctly even if not last lineaycabta
https://github.com/ruby/reline/commit/21d75f6d4c
2022-01-16[ruby/reline] Insert newline in the middle of buffer just after dialogaycabta
https://github.com/ruby/reline/commit/0c76631132
2022-01-16[ruby/reline] Combine common logic into oneaycabta
https://github.com/ruby/reline/commit/5db9738f17
2022-01-16[ruby/reline] Clear dialog when adding new line to end of bufferaycabta
https://github.com/ruby/reline/commit/7d38454327
2022-01-11[ruby/reline] Clear dialog when just_move_cursor is called with dialog at ↵aycabta
last line https://github.com/ruby/reline/commit/05024b968e
2021-12-25[ruby/reline] Escape newline(s) in dynamic promptaycabta
https://github.com/ruby/reline/commit/9b209ee1ea
2021-12-25[ruby/reline] Escape newline(s) in promptaycabta
https://github.com/ruby/reline/commit/b545459fca
2021-12-25[ruby/reline] Remove unnecessary parameteraycabta
https://github.com/ruby/reline/commit/20fcd22564
2021-12-24[ruby/reline] Revert "Change aliased methods to be parivete"aycabta
Ruby 2.5 doesn't support "private alias_method" idiom but Ruby on Rails 6.x still support 2.5. 😢 This reverts commit https://github.com/ruby/reline/commit/0f075f562b9b. https://github.com/ruby/reline/commit/4ecaa63b26
2021-12-24[ruby/reline] Change aliased methods to be pariveteaycabta
https://github.com/ruby/reline/commit/0f075f562b
2021-12-24[ruby/reline] Add doc about em-kill-line macroaycabta
https://github.com/ruby/reline/commit/2e46493aff
2021-12-24[ruby/reline] Implement em_kill_lineaycabta
https://github.com/ruby/reline/commit/9fca6ceb45
2021-12-24[ruby/reline] Rename the wrong name "em-kill-line" with the correct name ↵aycabta
"unix-line-discard" https://github.com/ruby/reline/commit/da7af35d1f
2021-12-24[ruby/reline] Add doc about ed-kill-line, kill-line, em-kill-line, and ↵aycabta
unix-line-discard https://github.com/ruby/reline/commit/586a48ffe0
2021-12-24[ruby/reline] Character merging may increase the character widthaycabta
Even if the number of graphemes doesn't change owing to character merging, the character width may increase. https://github.com/ruby/reline/commit/fbcd5f56a7
2021-12-24[ruby/reline] Add comment for a following char of combined charaycabta
https://github.com/ruby/reline/commit/d465667f57
2021-12-21[ruby/reline] Finalize when exception occurredaycabta
https://github.com/ruby/reline/commit/1f8a3aee43 Co-authored-by: Alex Gittemeier <[email protected]>
2021-12-21[ruby/reline] Split off set_signal_handler methodaycabta
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
2021-12-20[ruby/reline] Add support for overwriting dialog proc with the same nameaycabta
https://github.com/ruby/reline/commit/16aa20c380
2021-12-19[ruby/reline] Clear dialog in pastingaycabta
https://github.com/ruby/reline/commit/dabf5313e0
2021-12-13[ruby/reline] Remove unnecessary variables, lower_spaceaycabta
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
2021-11-21[ruby/reline] Correct padding space calculationima1zumi
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
2021-10-12[ruby/reline] Revert "Fix zero division when the screen width is not available"Nobuyoshi Nakada
This reverts commit 0dce9da083541f42c31822a91c72f339934c3986. https://github.com/ruby/reline/commit/f71471cdde
2021-10-12[ruby/reline] Fix zero division when the screen width is not availableNobuyoshi Nakada
https://github.com/ruby/reline/commit/0dce9da083
2021-10-09[ruby/reline] Add RELINE_ALT_SCROLLBAR env to use alternative text for scrollbaraycabta
The setting to use '::' instead of block elements. https://github.com/ruby/reline/commit/4afbc98e2c
2021-10-09[ruby/reline] Fix calculating dialog width with full-width scrollbaraycabta
https://github.com/ruby/reline/commit/93bc9b5277
2021-10-08[ruby/reline] Use alternate text for scrollbar in non-UTF-8 envaycabta
https://github.com/ruby/reline/commit/69e365edcc
2021-10-08[ruby/reline] Better fix for non-UTF-8 default external encodingJeremy Evans
Previous fix didn't show the cursor or dialogs. This allows the dialogs to continue to work. https://github.com/ruby/reline/commit/651c5f63cc
2021-10-08[ruby/reline] Only show dialogs if default external encoding is UTF-8Jeremy Evans
Fixes a crash in IRB if a dialog is displayed and the default external encoding is not UTF-8: /home/jeremy/tmp/reline/lib/reline/line_editor.rb:731:in `write': U+2588 from UTF-8 to US-ASCII (Encoding::UndefinedConversionError) https://github.com/ruby/reline/commit/f570525ecd