MCPcopy Index your code
hub / github.com/endbasic/endbasic / refresh_line

Method refresh_line

repl/src/editor.rs:648–661  ·  view source on GitHub ↗

Records the console changes needed to refresh only the current line and the status bar.

(mut self, file_pos: FilePos, line: &str, cursor: CharsXY)

Source from the content-addressed store, hash-verified

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

Calls 4

yxFunction · 0.85
pushMethod · 0.80
refresh_statusMethod · 0.80
is_emptyMethod · 0.45