Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
a031315
differential rendering
tompng Oct 19, 2023
60aeceb
Remove rendering and ivar update from update method
tompng Oct 21, 2023
5b0a82c
Remove duplicated state
tompng Oct 22, 2023
1a93a42
Autoindent
tompng Oct 22, 2023
d5d21f5
Resize, Clear
tompng Oct 22, 2023
9057ec9
Rerender on abort
tompng Oct 23, 2023
2b04afe
Bug fixes
tompng Oct 23, 2023
bdb4edf
readline returns nil if it is eof
tompng Oct 23, 2023
3c93a71
Test fix
tompng Oct 23, 2023
8b39e3d
simplify differential rendering
tompng Oct 24, 2023
c2f758e
autoindent-compatibility
tompng Oct 24, 2023
71587f7
finished_rendering
tompng Oct 24, 2023
961f855
fix rendering test
tompng Oct 24, 2023
4f0f7ad
fix cursor position recalculation
tompng Oct 24, 2023
10cef3e
update dialogs by key
tompng Oct 24, 2023
37a8ada
update(input_key, scroll_into_view, update_dialogs) then render
tompng Oct 24, 2023
47ec0a3
re-implement pre_input_hook
tompng Oct 24, 2023
a7586a6
rerender full content after finish
tompng Oct 24, 2023
7d7a4c5
numbert params to normal params
tompng Oct 24, 2023
53c8f2f
Autoindent compatibility
tompng Oct 24, 2023
a489d43
Fix for readline test
tompng Oct 24, 2023
f3c6791
Hack for readline test. (TODO: fix ext-readline's test)
tompng Oct 24, 2023
96c8e09
Use 24x80 size in test
tompng Oct 25, 2023
9c9f188
Fix DialogProcScope width hight calculation
tompng Oct 25, 2023
c5eabbe
Fix render_full_content and clearing screen
tompng Nov 22, 2023
405cd9d
Invalidate modified_lines cache when `finished?` changed
tompng Nov 28, 2023
138d4ef
Reuse cached value for heavy word-wrap calculation
tompng Nov 29, 2023
92899f0
Scrolldown after sigint
tompng Nov 30, 2023
37014b8
Remove useless cursor reset in em_delete/vi_list_or_eof action
tompng Nov 30, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lib/reline.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,12 @@ def readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination)
Reline::HISTORY << whole_buffer
end

line_editor.reset_line if line_editor.whole_buffer.nil?
whole_buffer
if line_editor.eof?
line_editor.reset_line
nil
else
whole_buffer
end
end
end

Expand Down Expand Up @@ -326,7 +330,7 @@ def readline(prompt = '', add_hist = false)
line_editor.prompt_proc = prompt_proc
line_editor.auto_indent_proc = auto_indent_proc
line_editor.dig_perfect_match_proc = dig_perfect_match_proc
line_editor.pre_input_hook = pre_input_hook
pre_input_hook&.call
@dialog_proc_list.each_pair do |name_sym, d|
line_editor.add_dialog_proc(name_sym, d.dialog_proc, d.context)
end
Expand All @@ -337,6 +341,7 @@ def readline(prompt = '', add_hist = false)
io_gate.set_default_key_bindings(config)
end

line_editor.print_nomultiline_prompt(prompt)
line_editor.rerender

begin
Expand All @@ -346,10 +351,8 @@ def readline(prompt = '', add_hist = false)
prev_pasting_state = io_gate.in_pasting?
read_io(config.keyseq_timeout) { |inputs|
line_editor.set_pasting_state(io_gate.in_pasting?)
inputs.each { |c|
line_editor.input_key(c)
line_editor.rerender
}
inputs.each { |c| line_editor.update(c) }
line_editor.rerender
if @bracketed_paste_finished
line_editor.rerender_all
@bracketed_paste_finished = false
Expand Down
2 changes: 1 addition & 1 deletion lib/reline/general_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def self.ungetc(c)
end

def self.get_screen_size
[1, 1]
[24, 80]
end

def self.cursor_pos
Expand Down
Loading