Enum text_terminal::DisplayAction
source · pub enum DisplayAction {
Delete {
screen_start: ScreenPoint,
num_units: usize,
scrollback_start: ScrollbackBufferPoint,
},
Erase {
screen_start: ScreenPoint,
screen_end: ScreenPoint,
},
Overwrite {
scrollback_start: ScrollbackBufferPoint,
scrollback_end: ScrollbackBufferPoint,
screen_start: ScreenPoint,
width_difference: i32,
},
Insert {
scrollback_start: ScrollbackBufferPoint,
scrollback_end: ScrollbackBufferPoint,
screen_start: ScreenPoint,
},
}
Expand description
A pending action to display content from the terminal’s scrollback buffer on the screen.
See the TerminalBackend::display()
for more information on how this type is used.
Variants§
Delete
Remove the given number of units from the screen starting at the given screen coordinate.
After the delete operation, all other units coming after that point in the current Line
are left-shifted by num_units
.
At that point, the Unit
s starting at the given scrollback_start
point in the scrollback buffer
should be displayed at the given screen_start
coordinate on screen.
For simplicity, this only supports a “forward” delete operation, in which the screen cursor position does not change because only the units at or after that screen cursor position are removed. A “backwards” delete operation can be achieved by moving the cursor backwards by a few units and then issuing a regular forward delete operation.
Erase
Erases the contents displayed on the screen in the given range of on-screen coordinates, setting those units to blank space without changing their display style.
The screen_start
bound is inclusive; the screen_end
bound is exclusive.
Overwrite
Fields
scrollback_start: ScrollbackBufferPoint
scrollback_end: ScrollbackBufferPoint
screen_start: ScreenPoint
Replace the contents displayed on the screen starting at the given on-screen coordinate with the contents of the scrollback buffer.
The scrollback_start
bound is inclusive; the scrollback_end
bound is exclusive;
the screen_start
bound is also inclusive.
The width_difference
represents the difference in the displayable width of the new unit(s)
vs. the old unit(s) that existed in the scrollback buffer and were previously displayed at screen_start
.
This is effectively new_unit_width - old_unit_width
.
- If
0
, the units are the same width. - If positive, the new unit is wider than the old unit.
- If negative, the old unit is wider than the new unit.
Insert
Fields
scrollback_start: ScrollbackBufferPoint
scrollback_end: ScrollbackBufferPoint
screen_start: ScreenPoint
Inserts the content from the given range in the scrollback buffer into the screen, starting at the given on-screen coordinate. After the content from the scrollback buffer is inserted, all other content currently on the screen will be shifted to the right and reflowed such that nothing else is lost.
The scrollback_start
bound is inclusive; the scrollback_end
bound is exclusive;
the screen_start
bound is also inclusive.