tUse tsetdirt in tscrollup and tscrolldown. - st - [fork] customized build of s… | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 3afdb4ff04b45a5e4209a56d5073341c9d506b38 | |
parent f9dc374ea01c2921ec3bd1214f292a7036d069ae | |
Author: noname <[email protected]> | |
Date: Sun, 20 Apr 2014 17:26:13 +0400 | |
Use tsetdirt in tscrollup and tscrolldown. | |
ttscrollup and tscrolldown do not use tsetdirt, but their code is | |
equivalent to | |
tsetdirt(orig, term.bot-n); | |
tsetdirt(orig+n, term.bot); | |
ttclearregion also marks cleared lines as dirty. | |
In tscrolldown it sets lines from term.bot-n+1 to term.bot dirty, and in | |
ttscrollup it sets lines from orig to orig+n-1 dirty. | |
In both functions all lines from orig to term.bot are effectively set | |
dirty, but in tscrolldown lines from orig+n to term.bot are set dirty | |
ttwice, and in tscrollup lines from orig to term.bot-n are set dirty | |
ttwice. | |
These patches make it clear which lines are set dirty and sets them | |
dirty once in each funciton. | |
Diffstat: | |
M st.c | 10 ++++------ | |
1 file changed, 4 insertions(+), 6 deletions(-) | |
--- | |
diff --git a/st.c b/st.c | |
t@@ -1399,14 +1399,13 @@ tscrolldown(int orig, int n) { | |
LIMIT(n, 0, term.bot-orig+1); | |
tclearregion(0, term.bot-n+1, term.col-1, term.bot); | |
+ tsetdirt(orig, term.bot-n); | |
+ tsetdirt(orig+n, term.bot); | |
for(i = term.bot; i >= orig+n; i--) { | |
temp = term.line[i]; | |
term.line[i] = term.line[i-n]; | |
term.line[i-n] = temp; | |
- | |
- term.dirty[i] = 1; | |
- term.dirty[i-n] = 1; | |
} | |
selscroll(orig, n); | |
t@@ -1419,14 +1418,13 @@ tscrollup(int orig, int n) { | |
LIMIT(n, 0, term.bot-orig+1); | |
tclearregion(0, orig, term.col-1, orig+n-1); | |
+ tsetdirt(orig, term.bot-n); | |
+ tsetdirt(orig+n, term.bot); | |
for(i = orig; i <= term.bot-n; i++) { | |
temp = term.line[i]; | |
term.line[i] = term.line[i+n]; | |
term.line[i+n] = temp; | |
- | |
- term.dirty[i] = 1; | |
- term.dirty[i+n] = 1; | |
} | |
selscroll(orig, -n); |