-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
osc133: initial patch implementation (#127)
* osc133: initial patch implementation * Specify dependency on reflow or scrollback patch
- Loading branch information
1 parent
e7bdaa6
commit fe065cc
Showing
8 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 })); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
static void scrolltoprompt(const Arg *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,7 @@ | |
#endif | ||
#if XRESOURCES_PATCH | ||
#include "xresources.c" | ||
#endif | ||
#endif | ||
#if OSC133_PATCH | ||
#include "osc133.c" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,3 +41,6 @@ | |
#if XRESOURCES_PATCH | ||
#include "xresources.h" | ||
#endif | ||
#if OSC133_PATCH | ||
#include "osc133.h" | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters