aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/samterm
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-05-10 19:27:45 +0000
committerrsc <devnull@localhost>2007-05-10 19:27:45 +0000
commitaf4c27865c17dd274cc92cb4a464cb273e4e61ec (patch)
treeac0515a7dc88b7df12df1734d634e7b51eb7a0a2 /src/cmd/samterm
parent7a3533513e6f401bf62d94d4577922771090ffb4 (diff)
downloadplan9port-af4c27865c17dd274cc92cb4a464cb273e4e61ec.tar.gz
plan9port-af4c27865c17dd274cc92cb4a464cb273e4e61ec.tar.bz2
plan9port-af4c27865c17dd274cc92cb4a464cb273e4e61ec.zip
Better tick management - no frdrawseltick calls.
Diffstat (limited to 'src/cmd/samterm')
-rw-r--r--src/cmd/samterm/flayer.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cmd/samterm/flayer.c b/src/cmd/samterm/flayer.c
index 6497eea6..f3707738 100644
--- a/src/cmd/samterm/flayer.c
+++ b/src/cmd/samterm/flayer.c
@@ -285,14 +285,15 @@ flsetselect(Flayer *l, long p0, long p1)
flfp0p1(l, &fp0, &fp1, &ticked);
if(fp0==l->f.p0 && fp1==l->f.p1){
if(l->f.ticked != ticked)
- frdrawseltick(&l->f, frptofchar(&l->f, fp0), fp0, fp1, 1, ticked);
+ frtick(&l->f, frptofchar(&l->f, fp0), ticked);
return;
}
if(fp1<=l->f.p0 || fp0>=l->f.p1 || l->f.p0==l->f.p1 || fp0==fp1){
/* no overlap or trivial repainting */
frdrawsel(&l->f, frptofchar(&l->f, l->f.p0), l->f.p0, l->f.p1, 0);
- frdrawsel(&l->f, frptofchar(&l->f, fp0), fp0, fp1, 1);
+ if(fp0 != fp1 || ticked)
+ frdrawsel(&l->f, frptofchar(&l->f, fp0), fp0, fp1, 1);
goto Refresh;
}
/* the current selection and the desired selection overlap and are both non-empty */
@@ -323,7 +324,7 @@ flfp0p1(Flayer *l, ulong *pp0, ulong *pp1, int *ticked)
{
long p0 = l->p0-l->origin, p1 = l->p1-l->origin;
- *ticked = 1;
+ *ticked = p0 == p1;
if(p0 < 0){
*ticked = 0;
p0 = 0;
@@ -429,7 +430,8 @@ flprepare(Flayer *l)
frinsert(f, r, r+n, (ulong)0);
frdrawsel(f, frptofchar(f, f->p0), f->p0, f->p1, 0);
flfp0p1(l, &f->p0, &f->p1, &ticked);
- frdrawseltick(f, frptofchar(f, f->p0), f->p0, f->p1, 1, ticked);
+ if(f->p0 != f->p1 || ticked)
+ frdrawsel(f, frptofchar(f, f->p0), f->p0, f->p1, 1);
l->lastsr = ZR;
scrdraw(l, scrtotal(l));
}