osc133: initial patch implementation (#127)
* osc133: initial patch implementation * Specify dependency on reflow or scrollback patch
This commit is contained in:
parent
e7bdaa65d7
commit
fe065cc366
8 changed files with 71 additions and 1 deletions
27
patch/osc133.c
Normal file
27
patch/osc133.c
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
void scrolltoprompt(const Arg *arg) {
|
||||
int x, y;
|
||||
#if REFLOW_PATCH
|
||||
int top = term.scr - term.histf;
|
||||
#else
|
||||
int top = term.scr - term.histn;
|
||||
#endif // REFLOW_PATCH
|
||||
int bot = term.scr + term.row-1;
|
||||
int dy = arg->i;
|
||||
Line line;
|
||||
|
||||
if (!dy || tisaltscr())
|
||||
return;
|
||||
|
||||
for (y = dy; y >= top && y <= bot; y += dy) {
|
||||
for (line = TLINE(y), x = 0; x < term.col; x++) {
|
||||
if (line[x].mode & ATTR_FTCS_PROMPT)
|
||||
goto scroll;
|
||||
}
|
||||
}
|
||||
|
||||
scroll:
|
||||
if (dy < 0)
|
||||
kscrollup(&((Arg){ .i = -y }));
|
||||
else
|
||||
kscrolldown(&((Arg){ .i = y }));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue