-
Notifications
You must be signed in to change notification settings - Fork 93
Windows fix #775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows fix #775
Changes from all commits
3e1cfa2
8050239
235367d
93a23bc
3875659
9b3ffd8
053bbdb
2429165
060ba14
df70541
eb5959c
5443ab5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -472,8 +472,11 @@ def render_finished | |
| end | ||
|
|
||
| def print_nomultiline_prompt | ||
| Reline::IOGate.disable_auto_linewrap(true) if Reline::IOGate.win? | ||
| # Readline's test `TestRelineAsReadline#test_readline` requires first output to be prompt, not cursor reset escape sequence. | ||
| @output.write Reline::Unicode.strip_non_printing_start_end(@prompt) if @prompt && !@is_multiline | ||
| ensure | ||
| Reline::IOGate.disable_auto_linewrap(false) if Reline::IOGate.win? | ||
| end | ||
|
|
||
| def render | ||
|
|
@@ -509,6 +512,7 @@ def render | |
| # by calculating the difference from the previous render. | ||
|
|
||
| private def render_differential(new_lines, new_cursor_x, new_cursor_y) | ||
| Reline::IOGate.disable_auto_linewrap(true) if Reline::IOGate.win? | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this needed? I think line_editor does not print line longer than terminal width. If this is needed, moving it to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The restore in deprep does not work because render_finished outputs a single, long line. If ENABLE_WRAP_AT_EOL_OUTPUT is turned off, no forced line breaks occur. Instead, the cursor stays at the end of the line and subsequent characters overwrite the end of the line. Therefore, it was necessary to insert control of ENABLE_WRAP_AT_EOL_OUTPUT in the appropriate place.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense. Thank you for the description 👍 |
||
| rendered_lines = @rendered_screen.lines | ||
| cursor_y = @rendered_screen.cursor_y | ||
| if new_lines != rendered_lines | ||
|
|
@@ -539,6 +543,8 @@ def render | |
| Reline::IOGate.move_cursor_column new_cursor_x | ||
| Reline::IOGate.move_cursor_down new_cursor_y - cursor_y | ||
| @rendered_screen.cursor_y = new_cursor_y | ||
| ensure | ||
| Reline::IOGate.disable_auto_linewrap(false) if Reline::IOGate.win? | ||
| end | ||
|
|
||
| private def clear_rendered_screen_cache | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding by reading the document is:
Is this right? If so, I think
def cursor_posshould useCursorPos.new(x, y - top). Can you check this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right.
I tried to modify cursor_pos, but even the cursor moving functions needed to take csbi.srWindow.Top into consideration. Needs some more work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in df70541 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you 👍