Records the console changes needed to refresh only the current line and the status bar.
(mut self, file_pos: FilePos, line: &str, cursor: CharsXY)
| 646 | |
| 647 | /// Records the console changes needed to refresh only the current line and the status bar. |
| 648 | fn refresh_line(mut self, file_pos: FilePos, line: &str, cursor: CharsXY) -> Self { |
| 649 | self.output.push(CapturedOut::HideCursor); |
| 650 | self = self.refresh_status(file_pos); |
| 651 | self.output.push(CapturedOut::SetColor(TEXT_COLOR.0, TEXT_COLOR.1)); |
| 652 | self.output.push(CapturedOut::Locate(yx(cursor.y, 0))); |
| 653 | self.output.push(CapturedOut::Clear(ClearType::CurrentLine)); |
| 654 | if !line.is_empty() { |
| 655 | self.output.push(CapturedOut::Write(line.to_string())); |
| 656 | } |
| 657 | self.output.push(CapturedOut::Locate(cursor)); |
| 658 | self.output.push(CapturedOut::ShowCursor); |
| 659 | self.output.push(CapturedOut::SyncNow); |
| 660 | self |
| 661 | } |
| 662 | |
| 663 | /// Records the console changes needed to refresh the whole console view. The status line |
| 664 | /// is updated to reflect `file_pos`; the editor is pre-populated with the lines specified |