diff options
author | Thomas Leitner <t_leitner@gmx.at> | 2019-10-04 10:03:32 +0200 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-12-17 13:19:37 +0900 |
commit | a1713bedb1de676fdd7d9bf3458b931c4702a1af (patch) | |
tree | f5962f0bfba674d12214661c2336635d5ad09c69 /lib/reline | |
parent | 11db4d3a3b315ed2495ec0cdde4449554c002bff (diff) | |
download | ruby-a1713bedb1de676fdd7d9bf3458b931c4702a1af.tar.gz |
[ruby/reline] Implement completion_append_character
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
Diffstat (limited to 'lib/reline')
-rw-r--r-- | lib/reline/line_editor.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index 9d8185ff00..7b67687400 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -10,6 +10,7 @@ class Reline::LineEditor attr_reader :byte_pointer attr_accessor :confirm_multiline_termination_proc attr_accessor :completion_proc + attr_accessor :completion_append_character attr_accessor :output_modifier_proc attr_accessor :prompt_proc attr_accessor :auto_indent_proc @@ -58,6 +59,7 @@ class Reline::LineEditor def initialize(config) @config = config + @completion_append_character = '' reset_variables end @@ -620,8 +622,8 @@ class Reline::LineEditor @completion_state = CompletionState::MENU end if target < completed - @line = preposing + completed + postposing - line_to_pointer = preposing + completed + @line = preposing + completed + completion_append_character.to_s + postposing + line_to_pointer = preposing + completed + completion_append_character.to_s @cursor_max = calculate_width(@line) @cursor = calculate_width(line_to_pointer) @byte_pointer = line_to_pointer.bytesize |